waj has joined #crystal-lang
travis-ci has joined #crystal-lang
travis-ci has left #crystal-lang [#crystal-lang]
<travis-ci> [travis-ci] Build details : http://travis-ci.org/manastech/crystal/builds/30022858
<travis-ci> [travis-ci] manastech/crystal#1262 (master - 7873ddc : Ary Borenszweig): The build passed.
travis-ci has joined #crystal-lang
travis-ci has left #crystal-lang [#crystal-lang]
<travis-ci> [travis-ci] Build details : http://travis-ci.org/manastech/crystal/builds/30025916
<travis-ci> [travis-ci] manastech/crystal#1263 (master - a595384 : Ary Borenszweig): The build passed.
waj has joined #crystal-lang
waj has joined #crystal-lang
e_dub has joined #crystal-lang
bcardiff has joined #crystal-lang
travis-ci has joined #crystal-lang
travis-ci has left #crystal-lang [#crystal-lang]
<travis-ci> [travis-ci] Build details : http://travis-ci.org/manastech/crystal/builds/30041963
<travis-ci> [travis-ci] Change view : https://github.com/manastech/crystal/commit/25196bcdfc8f
<travis-ci> [travis-ci] manastech/crystal#1264 (llvm-config - 25196bc : Juan Wajnerman): The build passed.
irclogger_______ has joined #crystal-lang
kostya has joined #crystal-lang
e_dub has joined #crystal-lang
asterite has joined #crystal-lang
waj has joined #crystal-lang
bcardiff has joined #crystal-lang
<kostya> looks like crystal
<asterite> Definitely :)
<asterite> The other day I read this article: http://www.mrspeaker.net/2014/06/04/selling-swift/
<asterite> So Swift = Python + Ruby + Javascript + Haskell + Go + Kotlin + Lua + Typescript + Coffeescript + Groovy + Rust + ...
e_dub has joined #crystal-lang
<farleyknight> kostya, I'm not seeing it
<farleyknight> Way more like ECMAScript than anything
waj has joined #crystal-lang
waj has joined #crystal-lang
e_dub has joined #crystal-lang
emmanueloga has joined #crystal-lang
<asterite> hi emmanueloga!
<farleyknight> asterite, Can you explain this behavior? https://gist.github.com/farleyknight/4a7fd7ef1330ac9ca431
<asterite> Yes
<asterite> Crystal determines that @x is nilable, because there's one initialize that doesn't initialize @x to any value
<asterite> You can do: if x = @x; (x + 3).to_s; end
<asterite> Because doing "if" with an instance variable doesn't make the instance variable not-nil inside the "if" (unlike regular variables)
<farleyknight> So you can't infer that the @x inside the if statement is not nil?
<asterite> No, because maybe between that statement and the next one another thread makes @x nil
<asterite> At least that's our excuse for not implementing it :-P
<asterite> But another thread can't change a local variable
<farleyknight> Okay, I've used try a few times.. It seems the the appropriate thing here..
<bcardiff> farleyknight might be expecting the if @x to restrict @x to be non nillable. right?
<asterite> Yes, but that's not safe, at least not in a concurrent world
<farleyknight> Will there ever be "locked" classes where instance variables can't be modified by outside threads?
<waj> I think it would be fairly complicated for the compiler to deduce that
<emmanueloga> hey asterite :)
<farleyknight> I think the try idiom is a fair enough replacement for that bit of inference. I was just a bit confused why it worked fine for local variables but not instance variables!
<asterite> Yes… `try` and `if var = @var` are the two alternatives that we have right now
Prep has joined #crystal-lang
e_dub has joined #crystal-lang
bcardiff has joined #crystal-lang
asterite has joined #crystal-lang