jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.9.1 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vl3Zo
<crystal-gh> crystal/master 13800a7 TSUYUSATO Kitsune: Improve Range#sum performance...
<crystal-gh> crystal/master af85376 Ary Borenszweig: Merge pull request #1836 from MakeNowJust/feature/range-sum...
NeverDie has quit [Quit: http://radiux.io/ -> Manhattan Project]
<travis-ci> manastech/crystal#af85376 (master - Merge pull request #1836 from MakeNowJust/feature/range-sum): The build passed. https://travis-ci.org/manastech/crystal/builds/88467025
<DeBot> https://github.com/manastech/crystal/pull/1836 (Improvement `Range#sum` performance)
Cidan is now known as zz_Cidan
rosylilly has joined #crystal-lang
trapped has joined #crystal-lang
rosylilly has quit []
adler has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blue_deref has quit [Quit: bbn]
leafybasil has quit [Remote host closed the connection]
NeverDie has joined #crystal-lang
NeverDie has quit [Max SendQ exceeded]
NeverDie has joined #crystal-lang
leafybasil has joined #crystal-lang
leafybasil has quit [Ping timeout: 250 seconds]
adler has quit [Remote host closed the connection]
zz_Cidan is now known as Cidan
pawnbox has joined #crystal-lang
toydestroyer has quit [Ping timeout: 252 seconds]
toydestroyer has joined #crystal-lang
adler has joined #crystal-lang
adler has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
leafybasil has quit [Ping timeout: 260 seconds]
adler has joined #crystal-lang
adler has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
leafybasil has quit [Ping timeout: 272 seconds]
sdogruyol has joined #crystal-lang
BlaXpirit|m has quit [Quit: AndChat]
sdogruyol has quit []
blue_deref has joined #crystal-lang
BlaXpirit has joined #crystal-lang
Cidan is now known as zz_Cidan
NeverDie has quit [Quit: http://radiux.io/ -> Manhattan Project]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
leafybasil has joined #crystal-lang
leafybasil has quit [Ping timeout: 256 seconds]
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 265 seconds]
tdc has joined #crystal-lang
blue_deref has quit [Quit: bbn]
leafybasil has joined #crystal-lang
leafybasil has quit [Ping timeout: 256 seconds]
pawnbox_ has quit [Remote host closed the connection]
NeverDie has joined #crystal-lang
pawnbox has joined #crystal-lang
cyjimmy264 has joined #crystal-lang
toydestroyer has quit [Remote host closed the connection]
toydestroyer has joined #crystal-lang
trapped has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
leafybasil has joined #crystal-lang
kgadek has joined #crystal-lang
trapped has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<BlaXpirit> so i'm getting Index out of bounds
<BlaXpirit> and i have no idea where in the program it is, not even approximately
<BlaXpirit> like seriously what kind of traceback is that
SergXIIIth has quit [Remote host closed the connection]
trapped has joined #crystal-lang
<jhass> you have the method names in there?
nakilon has joined #crystal-lang
zz_Cidan is now known as Cidan
pawnbox has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kgadek has quit [Quit: gone sleep]
xAndy has joined #crystal-lang
<xAndy> hi i have a case, when construct to handle different classes and return their string representation. i only want my function to handle specific types so i have no else clause. but that causes my function to be of type String? and not String.
<BlaXpirit> xAndy,
<BlaXpirit> give example please
<BlaXpirit> xAndy, throw an exception otherwise
<BlaXpirit> how else do you think it could be handled
<xAndy> i was hoping i could get a compile time error
<BlaXpirit> how can a function return a string and not return anything at the same time
<xAndy> not a runtime error as the valid types are all in the case construct
<BlaXpirit> xAndy, that makes no sense, what if you pass a value constructed at runtime
<xAndy> BlaXpirit ok i have a better example for my problem
DeBot has quit [Quit: Crystal IRC]
DeBot has joined #crystal-lang
<xAndy> as you can see the case clause should always return
<xAndy> might the recursion be a problem for the type system?
<BlaXpirit> xAndy, throw an exception anyway
<jhass> xAndy: that's something it should recognize eventually, yeah. Feel free to open an issue
<BlaXpirit> xAndy, raise "this branch will never be reached"
<jhass> xAndy: as for the workaround, do value = case ...; value.not_nil!
<xAndy> jhass ok, i will simplify the code and open an issue
danzilio has quit [Ping timeout: 240 seconds]
bougyman has quit [Ping timeout: 240 seconds]
bjmllr has quit [Ping timeout: 240 seconds]
aemadrid has quit [Ping timeout: 240 seconds]
<RX14> > "test"
<RX14> >> "test"
<DeBot> RX14: # => "test" - http://carc.in/#/r/lgp
<RX14> i remember now
bjmllr has joined #crystal-lang
danzilio has joined #crystal-lang
kgadek has joined #crystal-lang
aemadrid has joined #crystal-lang
Dreamer3 has quit [Ping timeout: 240 seconds]
bougyman has joined #crystal-lang
<xAndy> jhass https://github.com/manastech/crystal/issues/1846 i hope i covered everything
<RX14> xAndy, umm, isn't that correct?
<RX14> that case looks like it should return string to me
<RX14> wait what
<RX14> i see
<jhass> xAndy: thanks
<RX14> that fucking ? instead of String|Nil needs to go in the error messages
<RX14> it's fine for a code shorthand
<RX14> but it should be String|Nil in printed error messages
<RX14> String? is kinds easy to miss for me
<jhass> RX14: open an issue ;)
<BlaXpirit> RX14, maybe you're right
<xAndy> jhass it works if the function signature ends on :String without the white space
<xAndy> at least your 2nd example
<RX14> opened an issue
<jhass> xAndy: http://carc.in/#/r/lgr no?
<jhass> oO weird
<jhass> that's a parser bug I bet
<xAndy> in that case even a return 123 does not throw an error as the :String is simply ignored i guess
<jhass> yeah
<xAndy> seems like i have a hand for bugs. the same thing(10 minutes with a language, 2 bug reports) happened to me when i tried rust 2 years ago lol
<RX14> xAndy, lol
<RX14> but still
<RX14> how had nobody failed at method:Type
<RX14> lol
<xAndy> to be fair the sublime syntax package for crystal gets it right, if the space is missing the color of the return type changes
<RX14> damn
<RX14> i wish that the vim thing has all the fancies of the sublime package
<xAndy> i guess vim doens't take ~30 seconds to get responsive after it has been suspended on a non ssd
<RX14> yeah
<RX14> still, vim-crystal is cool
<RX14> also, the crystal tools should be able to work even with compile errors
Cidan is now known as zz_Cidan
zz_Cidan is now known as Cidan
jokke has quit [Quit: WeeChat 1.3]
jokke has joined #crystal-lang
kgadek has quit [Quit: gone sleep]
trapped has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kgadek has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vlcfq
<crystal-gh> crystal/master 3d29251 Ary Borenszweig: Fixed #1848: require space between ':' and return type in def
trapped has joined #crystal-lang
adler has joined #crystal-lang
blue_deref has joined #crystal-lang
<travis-ci> manastech/crystal#3d29251 (master - Fixed #1848: require space between ':' and return type in def): The build passed. https://travis-ci.org/manastech/crystal/builds/88548537
<DeBot> https://github.com/manastech/crystal/issues/1848 (Return type restriction ignored when whitespace is missing)
adler has quit [Remote host closed the connection]
nakilon has quit [Ping timeout: 260 seconds]
Dreamer3 has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vlcWd
<crystal-gh> crystal/master 6e9fba9 Ary Borenszweig: Fixed #1845: instance vars first assigned inside an exception handler are always marked as nilable
pawnbox has quit [Remote host closed the connection]
<travis-ci> manastech/crystal#6e9fba9 (master - Fixed #1845: instance vars first assigned inside an exception handler are always marked as nilable): The build passed. https://travis-ci.org/manastech/crystal/builds/88555689
<DeBot> https://github.com/manastech/crystal/issues/1845 (Segmentation fault when class assigned to instance variable raises in its initializer)
Cidan is now known as zz_Cidan
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nakilon has joined #crystal-lang
kgadek has quit [Quit: gone sleep]
kgadek has joined #crystal-lang
kgadek has quit [Client Quit]
nakilon has quit [Ping timeout: 244 seconds]
leafybasil has quit [Remote host closed the connection]
k2b6s9j has joined #crystal-lang
k2b6s9j has left #crystal-lang [#crystal-lang]
k2b6s9j has joined #crystal-lang
k2b6s9j is now known as kepler_
LB__ has joined #crystal-lang
<LB__> When I assign to a variable, how do I know whether I'm declaring a new local variable or assigning to one in an enclosing scope? What if I want the compiler to warn me about the former?
<jhass> LB__: there's no difference in crystal, assignment and declaration is the same
<LB__> So if I make a typo the compiler won't even warn me?
<jhass> LB__: IME if you really have the problem of forgetting which local variables are valid in your current scope, you write way too long methods
<jhass> Crystal doesn't warn, either something is valid or not
<jhass> and of course accessing a local that was never assigned will error
<LB__> IMO that's a pretty bad thing. Oh well.
<LB__> Wait, when you say "Crystal doesn't warn", do you mean there are never any warnings generated ever?
<jhass> no, only errors
<jhass> well, I guess we warn when you benchmark in non-release mode
<jhass> but that's like a stdlib warning, not a compiler warning
<LB__> That's going to be fixed, right? Surely there's some code that is obviously suspicious or wrong and the compiler can warn about it?
<jhass> LB__: if the compiler thinks something is wrong, it'll error out on it
<LB__> But it won't error out on typos?
<LB__> What about variables that are only assigned to and never used?
leafybasil has joined #crystal-lang
<LB__> I can get behind the 'errors only' thing, but only if it actually catches common mistakes
<jhass> erroring out on write only would be annoying as you temporarily comment out stuff
<LB__> So why not have a warning for it? For instance, if you forget to uncomment that code or you make a typo?
<jhass> people ignore warnings
<jhass> you'll end up having to use a library that produces lots
<jhass> so you'll ignore them even more
<LB__> I guess we'll just have t agree to disagree.
kepler_ is now known as kepler-Away
kepler-Away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zz_Cidan is now known as Cidan
LB__ has quit []
Cidan is now known as zz_Cidan
blue_deref has quit [Quit: bbn]
kgadek has joined #crystal-lang
kepler_ has joined #crystal-lang
kepler-Away is now known as kepler_
BlaXpirit has quit [Quit: Konversation]
<crystal-gh> [crystal] ch3n opened pull request #1849: Fix: File.basename("/") gets negative count (ArgumentError) (master...master) http://git.io/vlCT7
NeverDie has quit [Quit: http://radiux.io/ -> Manhattan Project]
zz_Cidan is now known as Cidan
kepler_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]