00:07
Volk has joined #crystal-lang
00:07
Volk has joined #crystal-lang
00:07
Volk has quit [Changing host]
02:37
Volk has quit [Quit: See you next time!]
02:38
Volk has joined #crystal-lang
02:38
Volk has quit [Changing host]
02:38
Volk has joined #crystal-lang
03:00
Volk has quit [Quit: See you next time!]
03:00
Volk has joined #crystal-lang
03:00
Volk has quit [Changing host]
03:00
Volk has joined #crystal-lang
04:45
<
f1refly >
hightower: Ohhh, I missed that! Thank you!
07:49
ur5us_ has joined #crystal-lang
07:50
ur5us has quit [Ping timeout: 264 seconds]
07:54
ur5us_ has quit [Ping timeout: 268 seconds]
08:20
notzmv has quit [Ping timeout: 252 seconds]
10:33
notzmv has joined #crystal-lang
10:46
postmodern has joined #crystal-lang
10:47
<
postmodern >
is there a helper method in Iterator for returning a single value, then stopping on next iteration?
11:16
<
postmodern >
hmm wtf, why can't I use enum values in a case ... in statement?
11:16
<
postmodern >
enums are supposed to be exhaustive, no?
11:26
deavmi has quit [Read error: Connection reset by peer]
11:26
deavmi_ has joined #crystal-lang
12:07
<
postmodern >
the compiler's `if var.nil? ... elsif var.method() ...` awareness could use some work
12:34
hightower2 has quit [Ping timeout: 252 seconds]
12:42
<
FromGitter >
<Blacksmoke16> Do you have an example of it not working?
13:05
<
FromGitter >
<Blacksmoke16> 1) you dont need to define those `one?` method and stuff, they're added automatically ⏎ 2) it would probably work if you assigned the ivar to a variable first
13:06
postmodern has quit [Read error: Connection reset by peer]
13:06
postmodern has joined #crystal-lang
13:10
<
postmodern >
Blacksmoke16, ah case style. I also noticed `if/else` worked, but `if / elsif` does not get caught by the compiler.
13:11
<
postmodern >
Blacksmoke16, after the initial nil check, the variable should be considered not-nil in all following branches
13:11
<
FromGitter >
<Blacksmoke16> not when you do `@ivar.nil?`
13:12
<
postmodern >
Blacksmoke16, after that branch, iff it's false
13:13
<
postmodern >
i'm guessing we just need better compiler logic for identifying if/elsif branches
13:30
hightower2 has joined #crystal-lang
13:50
<
yxhuvud >
No, if you check against an ivar, then some other fiber may change the value underneath the feet of the code.
14:35
Volk has quit [Quit: See you next time!]
14:51
hightower2 has quit [Ping timeout: 252 seconds]
15:36
Volk has joined #crystal-lang
15:36
Volk has joined #crystal-lang
15:36
Volk has quit [Changing host]
16:01
Volk has quit [Quit: See you next time!]
16:02
fifr[m] has quit [Read error: Connection reset by peer]
16:02
jhass[m] has quit [Read error: Connection reset by peer]
16:02
hamoko has quit [Write error: Connection reset by peer]
16:02
olbat[m] has quit [Read error: Connection reset by peer]
16:03
jhass[m] has joined #crystal-lang
16:05
<
postmodern >
yxhuvud, that's a valid concern. however `if @ivar.nil? ... else ...` works, but `if @ivar.nil? ... elsif ...` does not, which seems inconsistent.
16:05
fifr[m] has joined #crystal-lang
16:05
olbat[m] has joined #crystal-lang
16:05
hamoko has joined #crystal-lang
16:06
<
FromGitter >
<Blacksmoke16> got an example that shows this behavior?
16:09
<
postmodern >
also another method could somehow modify the ivars in the current fiber once inside a `if !@ivar.nil?` or `case @ivar` block
16:10
<
FromGitter >
<Blacksmoke16> right, which is the basis of the limitation
16:18
notzmv has quit [Ping timeout: 246 seconds]
16:54
notzmv has joined #crystal-lang
18:26
<
postmodern >
perhaps in the future it will be possible to lock an ivars value for a period of time to ensure consistency
18:26
<
FromGitter >
<Blacksmoke16> you already can do that `value = @ivar`
18:26
<
FromGitter >
<Blacksmoke16> tada
19:22
notzmv has quit [Remote host closed the connection]
20:50
hightower2 has joined #crystal-lang
21:36
ur5us_ has joined #crystal-lang
22:16
hightower2 has quit [Ping timeout: 252 seconds]
22:36
postmodern has quit [Quit: Leaving]