ChanServ changed the topic of #crystal-lang to: The Crystal programming language | | Fund Crystal's development: | GH: | Docs: | Gitter:
ur5us has quit [Ping timeout: 255 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Quit: Leaving]
Sankalp has quit [Ping timeout: 258 seconds]
ua_ has quit [Ping timeout: 276 seconds]
ua_ has joined #crystal-lang
jmdaemon has quit [Ping timeout: 250 seconds]
<FromGitter> <stellarpower> Trying to set up VS code for debugging. I've been following the instructions as here:
<FromGitter> <stellarpower> So far looks like it builds, but all I get when running is: `Could not load source '??'.`
<FromGitter> <stellarpower> Do folks know if this is expected to work at the moment, or are there known issues with the debugging with VS Code?
ua_ has quit [Ping timeout: 240 seconds]
<FromGitter> <stellarpower> Also see there's now an interpreter built-in, can't wait to try! Will I need to build form source?
Sankalp has joined #crystal-lang
Sankalp has quit [Changing host]
Sankalp has joined #crystal-lang
lanodan has joined #crystal-lang
<FromGitter> <> @stellarpower: yes you need to build from source
_ht has joined #crystal-lang
<FromGitter> <stellarpower> Presumably I should be able to do this bootstrapping crystal from pre-built binaries for my distro, then recompiling itself(?)
<FromGitter> <Blacksmoke16> What os are you on?
<FromGitter> <Blacksmoke16> /arch
<FromGitter> <Blacksmoke16> Most likely probably just need to clone the repo and run `make`
<FromGitter> <stellarpower> Ubuntu
<FromGitter> <stellarpower> Was just abotu to see if there's a build image I can run in a container instead
<FromGitter> <Blacksmoke16> I think there is, but don't remember the exact name
<FromGitter> <stellarpower> I see some stuff in Circle CI, presume that's doing it
<FromGitter> <stellarpower> Mm thanks. IF I can't get the recipe I'll just try building from source and manually copying out
<FromGitter> <stellarpower> BTW can I use the block forwarding syntax for binary operators?
<FromGitter> <stellarpower> `array.reduce(0, &+)`
<FromGitter> <Blacksmoke16> `array.sum`
<FromGitter> <stellarpower> Thanks, is the syntax possible though?
<FromGitter> <Blacksmoke16> technically yes, but doesnt work the way you think
<FromGitter> <stellarpower> Ah, it's the dot. Literally just came across it by accident.
<FromGitter> <stellarpower> So unary plus has higher precedence when trying to resolve that?
<FromGitter> <Blacksmoke16> more so that its the same as like `array.reduce { |v| +v }` which wouldn't actually sum them
<FromGitter> <Blacksmoke16> so you get the wrong, but technically correct, value
<FromGitter> <stellarpower> Yeah
<FromGitter> <stellarpower> So I mean say
<FromGitter> <stellarpower> &./ would work because there's no unary slash?
<FromGitter> <Blacksmoke16> correct
<FromGitter> <HertzDevil> no?
<FromGitter> <HertzDevil> it
<FromGitter> <HertzDevil> 'd still expand to `{ |v| v./ }`
<FromGitter> <Blacksmoke16> yea, but would fail since it needs another value.
<FromGitter> <stellarpower> Oh cause the dot is usiung it like a member?
<FromGitter> <Blacksmoke16> `1 / 2` is the same as `1./(2)`
<FromGitter> <Blacksmoke16> `/` is just a method
<FromGitter> <stellarpower> Yeah
<FromGitter> <stellarpower> So it's no different from taking any other member using that syntax. I don't know the term, but what would be &:methodName in Ruby
<FromGitter> <stellarpower> so Iguess back to the original point, then it's not possible to take a binary infix operator like that
<FromGitter> <HertzDevil> always think it is a mistake in both ruby and crystal that you can have fewer block parameters than there are yield arguments
<FromGitter> <stellarpower> I guess it kinda worksfrom the sense that you can just choose ot ignore them in the block
<FromGitter> <stellarpower> If a function operates a bit like a map, but actually you just want to iterate over it. Hash key-value pairse for example. Or you just want to execute it enough times
ua_ has joined #crystal-lang
notzmv has quit [Ping timeout: 244 seconds]
<FromGitter> <Blacksmoke16> fwiw `Hash` does provide like `each_value` and `each_key`
<FromGitter> <stellarpower> Yee
<FromGitter> <stellarpower> I think the stdlib is pretty covered, but form experience in Ruby I can easily imagine gems that don' overload in the same way. So if they provide one function that takes a proc then I can see how it's useful to be able to ignore the arguments, without needing a million underscores
<FromGitter> <stellarpower> IF you were doing networking stuff, maybe you only care about the body per request, and all the headers and cookies and response code info can just be discarded
ua_ has quit [Ping timeout: 246 seconds]
ua_ has joined #crystal-lang
lanodan has quit [Ping timeout: 258 seconds]
lanodan has joined #crystal-lang
_ht has quit [Remote host closed the connection]
notzmv has joined #crystal-lang
fifr_ has quit [Ping timeout: 240 seconds]