ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.20.5 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
akwiatkowski has quit [Ping timeout: 240 seconds]
soveran has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
soveran has quit [Ping timeout: 256 seconds]
txdv has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
Kug3lis has joined #crystal-lang
Kug3lis is now known as Kug3lis_off
txdv has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
_whitelogger has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 258 seconds]
danielpclark has quit [Ping timeout: 252 seconds]
danielpclark has joined #crystal-lang
mgarciaisaia has quit [Read error: Connection reset by peer]
mgarciaisaia has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 264 seconds]
Kug3lis_off is now known as Kug3lis
Kug3lis is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis
Kug3lis is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis
balduin has quit [Ping timeout: 255 seconds]
mgarciaisaia has quit [Quit: Leaving.]
Kug3lis is now known as Kug3lis_off
<FromGitter> <ezrast> What is the literal syntax for empty Tuples / NamedTuples?
<FromGitter> <ezrast> Sorry, not the literal, the class name
<FromGitter> <ezrast> like I can do `if kwargs.is_a? NamedTuple(a: String)` but I don't know how to check for the empty NamedTuple type.
<FromGitter> <ezrast> Or more specific to my actual problem, I have a generic class `Foo(T)` and sometimes need `T` to be a 0-length named tuple (and there is no `T` argument in the constructor to infer from).
ssvb has quit [Read error: Connection reset by peer]
mark_66 has joined #crystal-lang
akwiatkowski has joined #crystal-lang
soveran has joined #crystal-lang
sz0 has joined #crystal-lang
soveran has quit [Ping timeout: 245 seconds]
gloscombe has joined #crystal-lang
inersha has joined #crystal-lang
inersha has quit [Client Quit]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 260 seconds]
Raimondii is now known as Raimondi
<FromGitter> <fazibear> Hi, I'm trying to implement something like this http://ben.straub.cc/2013/03/05/libgit2-the-repository/ using https://github.com/puppetpies/crystal-libgit2 shard, but with no luck. I'm started with this snippet ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5891b2bdfba5bfea06b4eefc]
<FromGitter> <fazibear> Thanks for help!
bjz has joined #crystal-lang
grindhold has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
fazibear has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
Rinkana has joined #crystal-lang
<Rinkana> Hey guys, can i supress the messages returned for spesific lines within the playground?
fazibear has quit [Quit: leaving]
<Rinkana> One of my lines XMl.parse and it seems that it tries to send the whole file back and gives me timeouts
sz0 has quit [Quit: Connection closed for inactivity]
<danielpclark> @Rinkana Try putting a semicolon after it
<Rinkana> @danielpclark Hmm, still timeouts
soveran has quit [Remote host closed the connection]
bjz has joined #crystal-lang
bjz has quit [Ping timeout: 264 seconds]
bjz_ has joined #crystal-lang
soveran has joined #crystal-lang
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 240 seconds]
icezimm has quit [Quit: Connection closed for inactivity]
bmcginty has quit [Ping timeout: 240 seconds]
bmcginty has joined #crystal-lang
TheGillies has quit [Ping timeout: 255 seconds]
kiliankoe has quit [Ping timeout: 240 seconds]
kiliankoe has joined #crystal-lang
TheGillies has joined #crystal-lang
danielpclark has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite pushed 5 new commits to master: https://git.io/vDmoh
<crystal-gh> crystal/master e2d39ff Ary Borenszweig: Compiler: give correct error message when external names are involved. Fixes #3934
<crystal-gh> crystal/master add1d7d Ary Borenszweig: File::Stat: add `pipe?` method
<crystal-gh> crystal/master 08d436a Ary Borenszweig: Compiler: show reused number of .o files in stats
<DeBot> https://github.com/crystal-lang/crystal/issues/3934 (External name worsens an error message)
gloscombe has quit [Ping timeout: 264 seconds]
gloscombe has joined #crystal-lang
<jeromegn> I'm trying to implement the LibreSSL C bindings to compare with OpenSSL (in terms of performance), but I can't get the reading or writing from the socket to work. I think it has something to do with non blocking file descriptors. If I specify I want them to block, reading and writing seems to work, but never seems to return. The lib docs suggest to wait for
<jeromegn> the IOs to be readable / writable before retrying if I'm using non-blocking IO and the lib spits out a specific documented error. It does spit out that error, so I tried `IO.select` before every read/write, but that didn't work either. Anybody had this issue before? Non-blocking file descriptors and C bindings? Here are the lib docs:
gloscombe has quit [Remote host closed the connection]
gloscombe has joined #crystal-lang
<jhass> did they really change the API for that in libressl? that is can't you just reuse/copy-paste the openssl implementation?
akwiatkowski has quit [Ping timeout: 258 seconds]
<jeromegn> well, libtls is a different API yes. Initially I tried loading the LibreSSL libs (which include the openssl stuff) but got compile errors. I didn't bother too long since the libtls API is much simpler and thought it would be a quick implementation :)
<jeromegn> I'll give that another shot though
<jeromegn> some symbols are not implemented it seems
<jeromegn> it's API compatible with OpenSSL 1.0.1, but not with 1.0.2
<jeromegn> basically, their docs suggests using poll() or select() on the non blocking IO. crystal seems to suggest using fibers and channels instead of IO.select.
<RX14> jeromegn, IO.select shouldn't really be used
<RX14> it helps to understand what crystal is doing internally
<RX14> instead of viewing it as just "fibers and channels"
<RX14> it's implemented entirely within the stdlib using libevent
matp_ has joined #crystal-lang
<jeromegn> oh
matp has quit [Ping timeout: 255 seconds]
kostya_ has joined #crystal-lang
<RX14> we set the FD as nonblocking, call read() or write(), if it returns EAGAIN we ask libevent to wake up the fiber when the FD is readable/writable again
<jeromegn> oh, I see that now
<RX14> not sure how that fits in with libtls
<jeromegn> libtls has its own API for reading and writing to/from a socket. my implementation just calls those functions. they wanted to make a simple API and they succeeded. but now I find myself wanting more granular functions for my implementation.
<jeromegn> setting my IO as blocking (with `io.blocking = true`) kind of works, but I wonder about unintended consequences on it.
<jeromegn> *of this
<RX14> well, your IO won't be blocking
<RX14> is the first one
<jeromegn> hmm, I guess the OpenSSL impl also uses the LibSSL read and write functions and it works fine. I imagine the implementation on those vs the ones on LibTLS' are different.
<jeromegn> ha
balduin has joined #crystal-lang
<Yxhuvud> Blocking IO doesn't block?
<RX14> i said that wrong
<RX14> i meant it would block the whole application
<jeromegn> right
<jeromegn> I figured
<jeromegn> looking at LibSSL (not TLS), it looks like it should be suffering from the same issues within Crystal.
<jeromegn> there's a part about "non-blocking" IO.
<jeromegn> it seems to exhibit the same behavior as the LibTLS' tls_read function.
<RX14> i honestly have no idea how it works
<jeromegn> yea, mostly thinking out loud :D
<jeromegn> from that, it seems like my code is wrong.
<jeromegn> how surprising.
<RX14> well
<RX14> the crystal impl seems to be using something called a BIO
<RX14> which looks like it does the actual read/wriute part in crystal code
<RX14> yes
<RX14> it sets the bio earlier
<jeromegn> yea
<RX14> which openssl delegates to
<RX14> which calls the normal io.read/io.write which is written in crystal
<jeromegn> ah
<jeromegn> yes
<RX14> so looks like you can't do the same thing
<RX14> jeromegn, you want to detect the TLD_WANT_POLLIN/TLS_WANT_POLLOUT and do the same thing as IO::FileDescriptor
<jeromegn> ah
<jeromegn> that makes sense
<jeromegn> want_readable and such
<RX14> yes
<jeromegn> *wait_readable
<RX14> you can inherit IO::FileDescriptor as it would make it easier to reuse
<RX14> but just overload unbuffered_read/write to call the correct thing
<RX14> instead of LibC.read/LibC.write
<jeromegn> good idea
<RX14> although thats probably quite a lot of a hack
<RX14> because it will then only be able to work on filedescriptors
<RX14> oh jeromegn
<RX14> tld_connect_cba
<RX14> tls_connect_cbs
<RX14> seems to be analogous to openSSL's BIO somewhat
<RX14> ok
<RX14> that's nice
<RX14> that seems to be the way to go here
<jeromegn> hmm
<jeromegn> oh that seems new
<jeromegn> not in my version of libressl :) I'll update.
<RX14> you can paraphrase the impl from the openssl BIO even though they have different interfaces
<RX14> actually i'm not sure if you need the box
<RX14> hmm
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Remote host closed the connection]
<jeromegn> I'm not sure that function is available in the portable libressl
<jeromegn> I'm a bit confused by their openbsd vs portable repos
<RX14> well, thats the most correct function to use so...
<jeromegn> yes
<jeromegn> installing the latest, I'll check if it includes that function
<jeromegn> ah, it has it
<jeromegn> good
<RX14> huh
<RX14> it's not in the github repo
<RX14> is there really no way to stream a HTTP::Client request body without using an IO.pipe?
<RX14> it seems stupid
<RX14> there seems to be no way to get an io which you write to which is your "request body"
mark_66 has quit [Remote host closed the connection]
<jeromegn> IO.copy maybe?
<RX14> that requires an IO to write to
<RX14> HTTP::Client accepts an IO in the constructor
<RX14> which it using IO.copy on internally
<RX14> uses*
<jeromegn> ah
<RX14> so you have to pass in a pipe
<RX14> because cryatl doesn't seem to have an entirely userspace multi-fiber IO
<RX14> cross-fiber IO
<RX14> or really any way to do it as simply as parsing in the http server
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<jeromegn> RX14: thanks to you I'm making a lot of progress :)
<RX14> no problem
<FromGitter> <JekoTronik> Hi fellows!
<RX14> @JekoTronik hi!
<FromGitter> <JekoTronik> I discovered crystal i forgot how. Anyway it sounds fun and pretty so as a low level C programmer i am wondering if it could be used to generate something like .hex file for microcontroller?
<RX14> which microcontroller?
<RX14> we can do ARM and x86 only currently
<RX14> and the crystal stdlib can't really be used without an OS
<RX14> so you have to go without the stdlib which is a pain
<RX14> it's probably *technically* possible to use crystal on some ARM-based microcontrollers, but I wouldn't recommend it
<RX14> unless you're willing to essentially create your own stdlib from scratch
<FromGitter> <JekoTronik> Actually it is just for recreation. Looking for something else. Is crystal crystal compilée
<FromGitter> <JekoTronik> Sorry smartphone autocorrect
<FromGitter> <JekoTronik> Is crystal compiled in C then C in manchine code?
<RX14> crystal uses llvm to compile directly to machine code
<RX14> no C intermediate
<RX14> only llvm-ir intermediate
<FromGitter> <JekoTronik> Cool. I will read about it.
<RX14> the crystal compiler itself is also written in crystal
<FromGitter> <JekoTronik> As I just want to experiment, maybe lighting a LED on bare metal could be reachable even for me x_x if I start with little microcontroller
mgarciaisaia has joined #crystal-lang
<RX14> which microcontroller is it?
<FromGitter> <JekoTronik> I dont see the work behind the scene yet
<FromGitter> <JekoTronik> I have some 32bit arm cortex m4 and also some atmega 8bit
<FromGitter> <JekoTronik> (The idea of coding a uC with no C++ OO language turn me on)
<FromGitter> <JekoTronik> Haha
<RX14> the cortex m4 should be possible
<RX14> but you'll have to figure out how to boot the thing
<RX14> the AVR isn't possible currently
<RX14> at least not without some crystal compiler modifications
<FromGitter> <JekoTronik> Ok si
<RX14> there was someone else in here working on crystal on raw ARM, i forgot who
<FromGitter> <JekoTronik> Ok so i will give the m4 a try
<RX14> oh, it was jokke I think
<jokke> yup
<RX14> well, you can collaborate then :)
<FromGitter> <JekoTronik> Hi jokke
<jokke> hi o/
<jokke> so yeah i managed to compile a binary for m0 from crystal
<RX14> did it work?
<jokke> i haven't got a board here, so i couldn't flash. also it didn't really do anyhting
<jokke> there are a few caveats however
<jokke> as of now crystal doesn't support setting a linker section for variables/constants
<jokke> i have a branch in my crystal fork on github though: https://github.com/jreinert/crystal/tree/section_attribute
<FromGitter> <JekoTronik> erk
<FromGitter> <JekoTronik> Ari, subway
<jokke> it gives you an attribute @[Section(...)]
<RX14> jokke, did you PR it?
<jokke> RX14: nah. no tests. i don't know how to test it tbh
<RX14> hmm
<RX14> compile the binary then dump the sections?
<RX14> must be possible
<jokke> heh sure
<jokke> i actually did just that
<RX14> we have an ELF parser in crystal...
<jokke> objdump does the trick
<jokke> @JekoTronik you need the attribute to be able to write an interrupt vector in pure crystal
<jokke> basically you define a constant static array with function pointers to your interrupt handlers
<jokke> also you will need a linker script for your board
<jokke> @JekoTronik i plan to start working on a microcrystal lib which will be a tiny version of the crystal standard library
<RX14> i think that's a really good idea
<RX14> make it a shard
<jokke> sure
<RX14> i was thinking of that earlier
<RX14> a super-portable crystal prelude
<jokke> yeah
balduin has quit [Ping timeout: 255 seconds]
<jokke> but it's a lot of work
<RX14> it seems you can use quite a bit of the crystal stdlib
<RX14> if you're careful
<jokke> sure but it's always better to have a stripped down version so you wont make the mistake of using stuff which will fail silently until being linked
<RX14> well that's what specs are for
<jokke> how do you run specs then?
<jokke> you will have to use --cross-compile and link manually so that crystal doesn't link the libs you would need and then you couldn't run your test because linking would fail
<RX14> you would crystal build --cross-compile spec/**
<RX14> then link manually with nothing in your makefile
<RX14> and you could run that
<RX14> it'd just be a statically linked executable
Kug3lis_off is now known as Kug3lis
<jokke> yes sure. but as i said: instead of getting a NoMethodError you will get a linker error
<RX14> not unless you write your own lib def
<RX14> and if you're doing that
<RX14> then thats fine
Kug3lis has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <JekoTronik> Ok i have to read and digest all of it. I think i will come back later with questions ^^
<FromGitter> <JekoTronik> But it sounds very interesting
<FromGitter> <JekoTronik> It makes me think about zync
<FromGitter> <JekoTronik> Zinc* sorry
<FromGitter> <JekoTronik> @jokke and @RX14 thank you for the trade.
<jokke> sure thing
<FromGitter> <JekoTronik> Hope to get back here soon
<FromGitter> <JekoTronik> Cheers!
<crystal-gh> [crystal] denysvitali opened pull request #3967: Add support for SHA512 (master...master) https://git.io/vDYmc
<DeBot> https://github.com/crystal-lang/crystal/pull/3967 (Add support for SHA512)
balduin has joined #crystal-lang
kostya_ has quit [Remote host closed the connection]
balduin has quit [Ping timeout: 264 seconds]
<TheGillies> is there a branch with parallelism?
soveran has quit [Remote host closed the connection]
<adam12> TheGillies: Not that I know of - but you might be able to fake it with forking processes and channels to communicate between them
<adam12> TheGillies: assuming you need parallelism and not just concurrency
<FromGitter> <renich> It seems this channel is in English but here goes...
<FromGitter> <renich> Qué onda, Crystaleros! Los invito a la comunidad de Google+ en Español: https://plus.google.com/u/1/communities/101582295063679309686
<FromGitter> <renich> También, a los desarrolladores, si quieren, se les otorgará dueñez (ownership) si quieren
<FromGitter> <renich> Y, quisiera pedirles, publiquen de su existencia en el blog; aunque sea una pequeña línea, no?
<BlaXpirit> TheGillies, there is a branch but probably not worth trying. why not tell us what you want to do
DeBot has quit [Remote host closed the connection]
DeBot has joined #crystal-lang
<FromGitter> <fridgerator> @adam12 is there an example of communicating cross process using channels somewhere?
<adam12> @fridgerator My best guess would be the source code for the channels library, or the docs for Channel.
<adam12> I think there were examples in the source, with one of them being a channel implementation, but not 100% on that.
<RX14> i'm not sure you can do that
<jeromegn> I've been wondering about that too, communicating across processes (across forks)
<jeromegn> maybe through some IO somewhere.
<adam12> err, you're right
<adam12> I think IO.pipe was the option
<adam12> ;\
<RX14> yup
<RX14> that would work
soveran has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 260 seconds]
Raimondii is now known as Raimondi
<jeromegn> so if I compile my program, do I need all the libs it require to run the compiled binary? could I put it in a "scratch" (empty) docker image like it's possible to do with golang binaries?
<RX14> jeromegn, nope
<RX14> you need the libs
<jeromegn> ah, yea, just found an issue about htat
<jeromegn> *that
<RX14> static compilation has some benefits but it's not really the standard
<jeromegn> indeed
<jeromegn> we'd have to write everything native to crystal I guess
<RX14> i'd rather link openssl than doing what go does
<jeromegn> RX14: why's that? I heard it has a good ssl/tls lib by default.
<RX14> i'd rather every langauge didn't have it's own implementation of crypto
<jeromegn> right
<jeromegn> I've been writing one of our golang programs using Crystal and it's almost twice as fast...
<RX14> there should be a few, good, implementations that everyone uses
<tilpner> What about statically linkined openssl?
<jeromegn> (not related to what I was asking about before)
<tilpner> *linking
<RX14> an impl-per-langue doesn't compete with other impls
<RX14> so you get the worst of both worlds:
<RX14> no competition, and loads of implementations to patch
<RX14> and maintain
<jeromegn> I guess if I want a small container, I can always use alpine with the few libs required.
<RX14> crystal on alpine doesn't have any packages unfortunately
<RX14> it should...
<jeromegn> can't it be compiled though?
<RX14> there's a few dependant packages that weren't up-to-date/available though
<RX14> or there was last time I checked
<RX14> plus you need to cross-compile for alpine
<RX14> so
<RX14> not really
<jeromegn> RX14: I just read that comment on an issue where you're saying you'd be happy to work on submitting a package for alpine :D
<jeromegn> oh
<jeromegn> I see
<jeromegn> bummer
<RX14> because it uses musl
akwiatkowski has joined #crystal-lang
<jeromegn> that's not too bad
gloscombe has quit [Remote host closed the connection]
balduin has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
<FromGitter> <martinium> anyone around?
soveran has quit [Remote host closed the connection]
matp_ has quit [Remote host closed the connection]
matp has joined #crystal-lang
<jokke> anyone know of a fuzzy search lib usable by crystal/written in crystal?
<jokke> levenshtein doesn't cut it here
<TheGillies> BlaXpirit: Don't need it for anything, just wanted to mess around
soveran has joined #crystal-lang
<Yxhuvud> jokke: Why don't levenstein cut it? What are you trying to do?
<jokke> Yxhuvud: i want to be able to find matches for phrases where the order of the words shouldn't have a huge impact on the result
<FromGitter> <martinium> are you able to bind a variable to an If conditional block?
<FromGitter> <martinium> I am trying to do that
<FromGitter> <martinium> or can you create a variable using an If block within a method that would be available through the entire function/method’s scope?
<jokke> TheGillies: nope
<jokke> sorry
<jokke> Yxhuvud:
<Yxhuvud> you may still steal the idea to compare trigrams though
<jokke> mmh yeah maybe i should
<jokke> Yxhuvud: right now i'm using my own weird scoring algorithm https://p.jreinert.com/hTbu/
<Yxhuvud> yeah that seems a bit slow
<jokke> naah it's ok
soveran has quit [Remote host closed the connection]
<RX14> @martinium that happens already
<RX14> if blocks are expressions and foo = if works
<RX14> but mosre recommended is just to set variables in if blocks
<RX14> like this: https://carc.in/#/r/1lhj
<FromGitter> <martinium> thats exactly what I am attempting
<FromGitter> <martinium> let me show you
Rinkana has quit [Quit: Page closed]
<FromGitter> <martinium> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58924a962ff29dec0665eb6b]
<FromGitter> <martinium> I have all the elsif’s commented out
<FromGitter> <martinium> but keep getting an error
<FromGitter> <martinium> wanted to test with just the first line
<FromGitter> <martinium> it doesn’t run the loop I have set up
<RX14> have you read the error?
<FromGitter> <martinium> no overload matches 'HTTP::Client.get' with type (String | Nil) ⏎ Overloads are: ⏎ ⏎ 1) HTTP::Client.get(url : String | URI, headers : HTTP::Headers | ::Nil = nil, body : BodyType = nil, tls = nil) ⏎ 2) HTTP::Client.get(url : String | URI, headers : HTTP::Headers | ::Nil = nil, body : BodyType = nil, tls = nil, &block) ... [https://gitter.im/crystal-lang/crystal?at=58924b0c2ff29dec0665ed6d]
<RX14> so what happens if the if statement doesn't get triggered?
<RX14> what would api_query be then?
<FromGitter> <martinium> wonder if a case statement would be better suited here
<RX14> api_query would be nil
<RX14> so the type is String or nil
<RX14> which is why you're getting the error
<FromGitter> <martinium> let me try and change
<RX14> if you put a raise in your else statement the variable can't be nil
<RX14> so thats one option
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<FromGitter> <martinium> yeah changed else clause to = “” as a test and it fixed the error
<RX14> the error message does make sense if you read it
<FromGitter> <martinium> it did
<FromGitter> <martinium> I’m at work sneaking in coding time
<FromGitter> <martinium> lol
<FromGitter> <martinium> Cool I am on the right path again
<FromGitter> <martinium> @RX14 do you work on Crystal itself?
<RX14> i do sometimes, yes
<RX14> not too much as i'm quite busy
<RX14> but I have had my fair share of PRs
<RX14> and I'm quite active on the issue tracker
<FromGitter> <martinium> nice
<FromGitter> <martinium> you are a big help usually whenever I come in here. It is appreciated.
<FromGitter> <martinium> Noobs like me would get nowhere without willing helpers like yourself.
<FromGitter> <martinium> Well I’d get there but after lots of needless frustration lol
<FromGitter> <martinium> in short thank you
<FromGitter> <martinium> :-p @RX14
<RX14> not a problem
<FromGitter> <paulcsmith> Is it possible to capture a method and use it as a block? Something like `[1, 2, 3].map ->double(Int32)`. Full example: https://play.crystal-lang.org/#/r/1lhl
<FromGitter> <asterite> &->
ssvb has joined #crystal-lang
mgarciaisaia1 has joined #crystal-lang
<FromGitter> <paulcsmith> Awesome! Thanks @asterite. What is that called? I tried looking in the docs and wasn't able to find it
<RX14> it's a combination of 2 operators
<RX14> -> converts it to a proc like usual
<RX14> the & just pastes that proc in as the block
<RX14> it ends up looking like map { |*args| proc.call(*args) } eventually
<RX14> so it's not as cheap as a method call to do it that way
<RX14> at least iirc, @asterite can correct me on that
mgarciaisaia has quit [Ping timeout: 258 seconds]
<FromGitter> <paulcsmith> Ah so -> makes it look like `proc.call` and the `&` wraps it in `{ | args|...`?
<RX14> yes, & can pass a proc into a function
<RX14> as it's block
<FromGitter> <paulcsmith> Very cool. Thanks for the explanation :)
<FromGitter> <paulcsmith> I'm sure the performance hit is probably small so it's probably fine in most cases. I'm just glad this can be done. Makes some code a lot easier to read and share :thumbsup:
<RX14> yep, unless it's in a tight loop
<RX14> main thing is it makes it transparent to llvm actually
<RX14> so it can't inline and merge
<RX14> i mean opaque to llvm
<FromGitter> <ezrast> I'm getting `Bug: already had enclosing call` from `crystal spec`; is that referring to a bug that should be reported?
<RX14> yes, a message containing "Bug:" from the crystal compiler is a compiler internal bug
<RX14> try and reduce the code needed to reproduce it, and post it to github
<FromGitter> <ezrast> Will do
soveran has quit [Remote host closed the connection]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mgarciaisaia1 has left #crystal-lang [#crystal-lang]
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
<FromGitter> <ezrast> Appears to be related to https://github.com/crystal-lang/crystal/issues/2665 ; are further reports there just noise at this point?
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]