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
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
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…]