RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
tobyfree has quit [Quit: Page closed]
duane has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <aisrael> So… currently we can’t have generic type aliases? E.g. `alias Maybe(T) = Nothing(T) | Just(T)`?
<FromGitter> <bew> no, but you can use a struct for that
<FromGitter> <aisrael> πŸ’‘
<FromGitter> <bew> huh just let me think.. I had a similar problem some time ago, will check how I handled this
<FromGitter> <bew> @aisrael why `Nothing` has a type?
<FromGitter> <bew> and why even use this nothing/just pattern?
<FromGitter> <bew> you don't need that in Crystal
<FromGitter> <aisrael> Just crazy enough to try and do monads in Crystal :)
<FromGitter> <bew> I did a little functionnal parsing with combinators in Crystal, I'll put it in a gist, maybe you'll find how to handle your crazy experiement :)
<FromGitter> <aisrael> 😸
<FromGitter> <bew> here you go :)
<FromGitter> <bew> check out the link at the top, it's a tutorial in F# about it, which I used to make this experiment
<FromGitter> <aisrael> Am starting to understand. OTOH, I guess what am treally trying to do is a bit of functional error handling: ⏎ ⏎ ```type Result<'a> = ⏎ | Success of 'a ⏎ | Failure of string ``` [https://gitter.im/crystal-lang/crystal?at=5a84e533d74ee9f50dc7230c]
<FromGitter> <bew> yeah I decided that I didn't need the `Result`, but you'll see that I always return either `Success` with some fields, or `Failure` with a message
<FromGitter> <bew> For example, here https://gist.github.com/bew/90b680fdcb541aa5062400f289181b42#file-5_combinators-cr-L72 I use a case .. when .. end, to do sth like a match in functional languages
<FromGitter> <bew> (line 72, just click on the link)
jnyw has joined #crystal-lang
<FromGitter> <aisrael> True. But then if this gets used far and wide a) it becomes tedious to have to write `Success(A) | Failure` everywhere, and then b) what if you (for whatever reason) need to add another option (e.g. `SuccessWithWarnings(A)` then client code everywhere has to change, to.
<FromGitter> <bew> a) don't write it, the Crystal compiler can figure this out for you!
<FromGitter> <bew> b) how would you handle this in a functional lang?
<FromGitter> <aisrael> a) Yeah, that's also true but now you kinda lose some type safety don't you? Or maybe not depending on use. But I like type annotations (almost) everywhere ⏎ b) Well, in e.g. Haskell `data Maybe a = Just a | Nothing`
<FromGitter> <bew> a) No, it's still type safe (Crystal <3)
<FromGitter> <bew> b) I meant, if you have to add another option like you suggested, wouldn't this change every client code everywhere too?
<FromGitter> <aisrael> Not necessarily, right? I mean, those methods declared`foo(result : Result(Bar))` can compile unchanged. Only if you need to handle `SuccessWithWarnings(Bar)` do you need to modify the method definition, right? ⏎ ⏎ OTOH, if you declared `foo(result : Success(Bar) | Failure)` now the code won't compile if called with the result of `method : Success(Bar) | SuccessWithWarnings(Bar) | Failure`
<FromGitter> <bew> @aisrael I agree type annotations are good to know what you have, but now that I use Crystal (too much?) I put type annotations in key places, but not every where, so for example, here, the only place where I put it was in the creation of a `Parser`, the passed function has to return a `Failure | Success(T)`, that's all needed! I could add a type annotation on `Parser#parse` method's return, but here the compiler
<FromGitter> ... will gently tell you that `@parser.call str` will return `Failure | Success(T)` and that you need to handle X case
<Papierkorb> aisrael, It's type safe in the language sense. You could say that we prefer to "don't state the obvious". A method like `returnTheString` is obvious in what it returns. That sample may look superificial at first, but really, most methods can be written to be practically obvious what'll happen. Use type restrictions where it's not obvious (and can't be made obvious), or where you want to re-enforce a users expectation.
<FromGitter> <aisrael> Anyway, yeah just saw #2803
<DeBot> https://github.com/crystal-lang/crystal/issues/2803 (Request for generic alias)
duane has quit [Ping timeout: 264 seconds]
<Papierkorb> Over-restrictions actually worsens your code quality, as it makes your algorithms less generic.
duane has joined #crystal-lang
<Papierkorb> aisrael, e.g. you have a method that operates read-only on a sequential container. Reasonable restriction: `def foo(list : Enumerable(String))` vs over restriction: `def foo(list : Array(String))`. In this sample, say you don't care about the T = String at all, it would be better to just do: `def foo(list : Enumerable)` if you want to restrict at all, or just `foo(list)`. `foo(list : Array)` would be worse.
<FromGitter> <bew> good point about genericity, ty Papierkorb!
<FromGitter> <aisrael> Hmmn... I guess am just looking for a way to have "ad-hoc polymorphism in a structured (type safe) way" (lifted from Haskell's type classes). ⏎ ⏎ However, TIL you can use a module/mixin as a type restriction! E.g. `Enumerable(T)`
<FromGitter> <aisrael> And of course abstract base classes... still, I'm putting my vote in for generic type aliases :)
<Papierkorb> You totally can, it's superb. You can also do stuff like `def combine_all(*many : Enumerable(T)) forall T`. This method will compile only if all passed arguments are Enumerables of Ts, but the kind of Enumerable doesn't matter, so you could pass an Array and a Tuple of Strings just fine
<FromGitter> <aisrael> TIL: `forall` "keyword"
<Papierkorb> forall is a keyword (no "" needed). You can define more than one 'type' there using comma: `forall T, U`. The type names have to be a single-letter
<Papierkorb> iirc the fancy name was "free variables"
<FromGitter> <bew> Papierkorb, just out of curiosity I'm looking at your bittorrent implem', and how you handle io https://github.com/Papierkorb/torrent/blob/master/src/torrent/util/network_order_struct.cr it's brilliant ✨
<FromGitter> <aisrael> Oh, brilliant! Crystal's `case ... when ...` works well with abstract base classes/polymorphism. :)
<FromGitter> <bew> can you show a sample of what you came up with?
<watzon> Yes please do aisrael, I'm curious now too
<watzon> I'm working on a library for parsing the `/proc` directory now. https://github.com/watzon/sysinfo.cr
<watzon> I feel like this is something we're missing
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
<watzon> Awesome :)
<FromGitter> <bew> I personally don't think that making a crystal version of those library is useful, but you can help make a good bindings of a library like the one I mentioned in this issue, that would be great! And as the lib is already multi-plateform you would have windows support (and lot others) for free :)
<watzon> Yeah I'm just not a big fan of C bindings personally. Even if they're more efficient, I'm willing to sacrifice a little efficiency for readability
<watzon> Plus it's fun to learn about the inner workings of linux
<FromGitter> <bew> sure, but a binding can be very readable you know :) (me too I tend to rewrite too much things x) )
<crystal-gh> [crystal] bmmcginty opened pull request #5720: Ensure that HTTP::WebSocket uses SNI, just like HTTP::Client. (master...sni) https://git.io/vAZgS
<FromGitter> <bararchy> Is this a new thing with HEAD ? ⏎ ⏎ ```while requiring "prelude": can't find file 'prelude'``` [https://gitter.im/crystal-lang/crystal?at=5a8514d2b3c4a0d37625f127]
<FromGitter> <bew> \o/
<FromGitter> <bararchy> what is this prelude thing ?
<FromGitter> <bew> it is a file that is required for you, with basic requires like array, string, hash, etc...
<FromGitter> <bew> but it's nto new
<FromGitter> <bararchy> :\ hm...
<wmoxam> path issue?
<FromGitter> <bew> just built HEAD, it's ok for me
<FromGitter> <bararchy> It's looking for this prelude in my own project path ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a851588b3c4a0d37625f3d8]
<FromGitter> <bararchy> is that ok ?
<FromGitter> <bew> hmm weird that it says "relative to"
<FromGitter> <bew> is it the full error?
<FromGitter> <bew> can you grep prelude see if you mistyped something somewhere?
<FromGitter> <bew> can you reproduce with a very simple program? or in an other directory?
<FromGitter> <bararchy> @bew are you on Linux ?
<FromGitter> <bararchy> or mac ?
<FromGitter> <bew> Linux
<FromGitter> <bew> ah
<FromGitter> <bew> no just `cd ..`
<FromGitter> <bew> then run your program
<FromGitter> <bararchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a8516aece68c3bc748af7cb]
<FromGitter> <bararchy> That's the fully error
<FromGitter> <bew> you need to be in the project root when running
<FromGitter> <bararchy> ofc I am, it worked the same for weeks, until i just installed HEAD
<FromGitter> <bew> yeah sorry, I went to fast on conlusion
<FromGitter> <bew> so is it reproductible with a simple program/in another directory? (in other word does it come from your code)
<FromGitter> <bararchy> @bew ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a851c05d74ee9f50dc80a11]
<FromGitter> <bararchy> Seems to be the same in all projects
<FromGitter> <bararchy> so, something with latest release or Arch Linux package ?
<FromGitter> <bew> maybe check `crystal env`, check the `CRYSTAL_PATH`, verify that the path to your cr install is correct
<FromGitter> <bararchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a851cc0e217167e2c87ab5a]
<FromGitter> <bararchy> hm....
<FromGitter> <bew> ah yes
<FromGitter> <bew> that's it
<FromGitter> <bew> `/tmp/yaourt-tmp-unshadow` is a temporary directory created by yaourt while compiling projects
<FromGitter> <bew> but it is removed when done
<FromGitter> <bew> so yeah, probably a change in the PKGBUILD
<FromGitter> <bararchy> jhass ?
<FromGitter> <bararchy> XD
<FromGitter> <bararchy> what is your PATH ?
<FromGitter> <bararchy> so I can fix mine
<FromGitter> <bew> last change 2 months ago, maybe he didn't push? or maybe the issue is somewhere else
<FromGitter> <bew> no idea if there is sth to do here and how..
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
duane has quit [Ping timeout: 268 seconds]
alex`` has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 252 seconds]
<watzon> How would I make a program daemonize itself?
<watzon> Never mind, looks like it's going to be a long answer based on Ruby examples haha
<watzon> I'll figure it out
alex`` has quit [Quit: WeeChat 2.0.1]
rohitpaulk has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
tobyfree has joined #crystal-lang
<tobyfree> is there anything like defined? from ruby available in crystal? or how can I check if a variable is defined before trying to access it?
snsei has quit [Remote host closed the connection]
alex`` has joined #crystal-lang
<FromGitter> <laginha87> I don't think you can, when you compile it will check if the variable is defined or not.
<FromGitter> <laginha87> if you're trying to do something along the lines of: ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=5a855233d74ee9f50dc92766]
<FromGitter> <laginha87> the compiler will declare before and it will have the type int|nil
<FromGitter> <laginha87> so you can check with a.nil?
<FromGitter> <bew> tobyfree that's not possible, why do you need it? what are you trying to do?
<FromGitter> <PlayLights_twitter> Only constants can be checked if they are defined
<FromGitter> <bew> well types too and methods (via macros), but not variables (and it won't be added)
<FromGitter> <aisrael> How do I use `NamedTuple`? I tried this and it blew up: ⏎ https://carc.in/#/r/3lb4
<FromGitter> <bew> you can't create a `NamedTuple` dynamically, you need to specify the types in the `NamedTuple` you're creating
<FromGitter> <bew> there is no way to do what you were trying to do in your example
<FromGitter> <bew> https://carc.in/#/r/3lb6
<FromGitter> <aisrael> Oh… I got it (had to read the docs of `#from_hash`)
bijan_ has joined #crystal-lang
maattdd has joined #crystal-lang
<FromGitter> <j8r> @aisrael why not use ```crystal ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=5a8565cb18f388e626a7fc83]
<FromGitter> <aisrael> I ended up using a `NamedTuple` literal anyway (which syntatically looks just like a hash)
<FromGitter> <j8r> yes. The only point I've found is we can't use keys with upcase
<FromGitter> <bew> @j8r just tested, `{Ab: 1}` works
<FromGitter> <j8r> really?
<FromGitter> <bew> really!
<FromGitter> <j8r> hum, I've a problem with: ⏎ ⏎ ```hash = NamedTuple.new(Ame: "name") ⏎ p hash[:Ame]``` [https://gitter.im/crystal-lang/crystal?at=5a85684e18f388e626a80ddb]
bijan_ is now known as bijan_awaaaay
<FromGitter> <j8r> but with `{Ame: "name"}` works?!
<FromGitter> <bew> yeah, it's because here you're using the 'traditional-with-a-method-call' creation method, and Ame is not recognized as an argument
<FromGitter> <bew> because arguments starting with an upcased letter are not allowed
<FromGitter> <bew> but with the literal syntax `{ab: 1}` the problem does not exist
maattdd has quit [Ping timeout: 256 seconds]
maattdd has joined #crystal-lang
bijan_awaaaay is now known as bijan_
TakeYourFreedom has joined #crystal-lang
<FromGitter> <j8r> is it better to use `"msg" + string` or `"msg #{string}"` for performance?
<FromGitter> <j8r> I use the latest avoid `to_s` when the variable isn't a string
<FromGitter> <bew> I'd say the first one, but it's negligible at this level
<FromGitter> <bew> you should use whatever you like
<FromGitter> <straight-shoota> interpolation should usually be preferred
<FromGitter> <bew> for just 2 string it doesn't matter, but for more than 2 string it might be more efficient yes
<FromGitter> <j8r> ok good to know
<FromGitter> <j8r> so why having the concatenation possibility?
<FromGitter> <j8r> compatibility with other languages I suppose
<FromGitter> <bew> no
<FromGitter> <bew> it's just 2 different things, 2 ways of resolving the same problem, and both ways have their usecase
bijan_ has quit [Quit: Shutting Down Interwebs...Done.]
hightower3 has joined #crystal-lang
jnyw has quit [Quit: WeeChat 2.0.1]
hightower2 has quit [Ping timeout: 264 seconds]
tobyfree has quit [Ping timeout: 260 seconds]
Take_Your_Freedo has joined #crystal-lang
TakeYourFreedom has quit [Ping timeout: 268 seconds]
sz0 has joined #crystal-lang
<FromGitter> <xfbs> Is there a method in crystal such that `['a', 'b', 'a', 'c', 'a', 'b'].some_meth # => {'a' => 3, 'b' => 2, 'c' => 1}` (meaning that it returns a hash or whatever with each element in the array and it's count)?
<FromGitter> <laginha87> @xfbs you can achieve it by doing ``` group_by{ |e| e }.map{|k,v| [k, v.size]}.to_h```
<FromGitter> <xfbs> Meh I ended up doing ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a858e444a6b0dd32bd551d4]
<FromGitter> <xfbs> Because I needed to preserve the order of the array
duane has joined #crystal-lang
maattdd_ has joined #crystal-lang
maattdd has quit [Read error: Connection reset by peer]
maattdd_ has quit [Read error: Connection reset by peer]
maattdd_ has joined #crystal-lang
jradd has quit [Ping timeout: 256 seconds]
maattdd_ has quit [Read error: Connection reset by peer]
maattdd_ has joined #crystal-lang
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Read error: Connection reset by peer]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Read error: Connection reset by peer]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Read error: Connection reset by peer]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Read error: Connection reset by peer]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
jradd has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Read error: Connection reset by peer]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Read error: Connection reset by peer]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Read error: Connection reset by peer]
jradd has quit [Ping timeout: 265 seconds]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Read error: Connection reset by peer]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Read error: Connection reset by peer]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
maattdd_ has quit [Read error: Connection reset by peer]
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
maattdd_ has joined #crystal-lang
qard has quit [Remote host closed the connection]
<FromGitter> <xfbs> Is there a performance penalty in passing a large struct around compared to parsing a large class around?
qard has joined #crystal-lang
<FromGitter> <xfbs> Because the struct is on the stack and the class on the heap?
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Read error: Connection reset by peer]
qard has joined #crystal-lang
qard has quit [Ping timeout: 256 seconds]
jradd has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
greengriminal has joined #crystal-lang
Take_Your_Freedo has quit [Remote host closed the connection]
Take_Your_Freedo has joined #crystal-lang
<FromGitter> <j8r> you can read this https://crystal-lang.org/docs/guides/performance.html
<FromGitter> <j8r> sructs are more efficient than classes, but from what I've heard it can have issues when large data are handled
Take_Your_Freedo has quit [Remote host closed the connection]
robacarp has quit [Ping timeout: 240 seconds]
maattdd has joined #crystal-lang
maattdd_ has quit [Read error: Connection reset by peer]
<txdv> yeah, because you push struts on the stack
<txdv> and big structs on the stack are stupid
<FromGitter> <xfbs> Well, I think I'm just gonna use a class since performance doesn't matter so much right now
<FromGitter> <xfbs> Btw I really love how `shards` puts all dependencies into `lib/`, it's so nice to be able to have the source code right there!
maattdd has quit [Ping timeout: 256 seconds]
maattdd has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
vivus has joined #crystal-lang
snsei has joined #crystal-lang
<FromGitter> <sdogruyol> @xfbs indeed, I also love how simple that is
vivus has left #crystal-lang ["Leaving"]
snsei has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <xfbs> True that.
greengriminal has joined #crystal-lang
greengriminal has quit [Client Quit]
greengriminal has joined #crystal-lang
ua_ has joined #crystal-lang
ua has quit [Ping timeout: 256 seconds]
greengriminal has quit [Quit: Leaving]
maattdd has quit [Ping timeout: 256 seconds]
ryan_ has joined #crystal-lang
<ryan_> Hi all, I'm having a problem with trying to get an Array(String) to append a String. I'm getting the following error message though: undefined method '<<' for Char (compile-time type is (Array(String) | Char))
<ryan_> puts output[0].class # Array(String)
<ryan_> puts ids.join("#") # String
<ryan_> output[0] << ids
<FromGitter> <straight-shoota> so `output[0]` can be `Char` somehow...
<FromGitter> <straight-shoota> probably because output is `String | Array(String)`
<ryan_> Hmm
<ryan_> data = CSV.parse(File.read('file.csv').scrub)
<ryan_> output = Array.new(data.size) { Array(String).new }
<FromGitter> <straight-shoota> you should make sure that it either can't be String or guard that code in a `if output.is_a? String`
<FromGitter> <straight-shoota> that's all you code?
<ryan_> Yeah
<ryan_> (For the setup part)
<FromGitter> <straight-shoota> please share all you code, there must be some place where `output` is assigned a Char
<FromGitter> <straight-shoota> preferably a reproducable example on https://carc.in
sz0 has joined #crystal-lang
<Yxhuvud> it is the output on line 9 that confuses it
rohitpaulk has quit [Ping timeout: 255 seconds]
TakeYourFreedom has joined #crystal-lang
<ryan_> Ah yes! That's it. Sorry for pestering on an idiotic error
rohitpaulk has joined #crystal-lang
duane has quit [Remote host closed the connection]
bijan_ has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <bararchy> Was there changes in HEAD regarding require and path of shards ?
<FromGitter> <bararchy> i'm getting wierd errors all around
<FromGitter> <straight-shoota> don't think so
<FromGitter> <xfbs> Are you guys interested in compiler crashes?
<oprypin> xfbs, i wouldn't say anybody's really excited about them. but it's important to report as a bug
<FromGitter> <xfbs> So it's worth taking some time to get it down to a minimal reproducible example or nah?
<oprypin> it depends
<FromGitter> <xfbs> On?
<oprypin> xfbs, how obscure your code is and how hard it may be to minimize
<oprypin> because i imagine it's not hard to find a compiler crash with a bunch of recursive type redefinitions
<FromGitter> <xfbs> I don't have any of those, but I'll minify anyways, hey maybe I can learn something?
bijan_ is now known as bijan_awaaaay
bijan_awaaaay has quit [Quit: System has gone to sleep. ZZZzzz…]
bijan_ has joined #crystal-lang
TakeYourFreedom has quit [Quit: Leaving]
bijan_ is now known as bijan_awaaaay
sz0 has quit [Quit: Connection closed for inactivity]
ryan_ has quit [Ping timeout: 260 seconds]
radagast_04 has quit [Ping timeout: 248 seconds]
<FromGitter> <xfbs> Alright, I minified it and posted an issue: https://github.com/crystal-lang/crystal/issues/5721
<FromGitter> <xfbs> Minimal reproducible code is ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ In case anyone wants to investigate. :) [https://gitter.im/crystal-lang/crystal?at=5a85fcefd74ee9f50dcd7e33]
<Yxhuvud> not minimal as it still crashes if you do `Crash.new` without assigning it to `crash`, but definitely repeatable.
<Yxhuvud> I'
<FromGitter> <xfbs> Okay, haven't thought of that. But I mean, without "minification" it was like 1.2k lines of code so I think I did an okayish job
<Yxhuvud> I beleive it isn't supposed to work to refer to instance variables in captured blocks, but it definitely shouldn't crash like that
<FromGitter> <xfbs> It works fine if you put the Hash.new{...} inside an initialize
duane has joined #crystal-lang
<FromGitter> <straight-shoota> It seems the issue is with the closure scope
<FromGitter> <straight-shoota> this works: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a8604b118f388e626ac26fb]
<FromGitter> <straight-shoota> This is a reduced example reproducing the error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a8604f493be87284dc1d103]
duane has quit [Remote host closed the connection]
bijan_awaaaay is now known as bijan_
duane has joined #crystal-lang
bijan_ is now known as bijan_awaaaay
bijan_awaaaay has quit [Quit: System has gone to sleep. ZZZzzz…]