<headius[m]>
ilikeorangutans irb does have a different way of running code that might explain it
<headius[m]>
I'll have a look tomorrow
xardion has quit [Ping timeout: 248 seconds]
him3010 has joined #jruby
rusk has joined #jruby
rusk has quit [Ping timeout: 268 seconds]
rusk has joined #jruby
lopex has quit [Ping timeout: 245 seconds]
lopex has joined #jruby
him3010 has quit [Ping timeout: 258 seconds]
Liothen has quit [Ping timeout: 250 seconds]
Liothen has joined #jruby
shellac has joined #jruby
shellac has quit [Quit: Computer has gone to sleep.]
kares_ has joined #jruby
kares has quit [Ping timeout: 244 seconds]
kares_ is now known as kares
enebo has quit [Ping timeout: 258 seconds]
enebo has joined #jruby
shellac has joined #jruby
KeyJoo has joined #jruby
ilikeorangutans has joined #jruby
shellac has quit [Ping timeout: 252 seconds]
<ilikeorangutans>
great, thanks headius!
xardion has joined #jruby
KeyJoo has quit [Quit: KeyJoo]
ilikeorangutans has quit [Ping timeout: 268 seconds]
ilikeorangutans has joined #jruby
xardion has quit [Remote host closed the connection]
xardion has joined #jruby
<ilikeorangutans>
so... i think i found something else that doesn't work right on lazy enumerators. on mri ruby, when using an infinte enumerator, this returns 3 elements and stops:
<ilikeorangutans>
enumerator.lazy.each_with_index.map { |x, i| x }.take(3).to_a
<ilikeorangutans>
on jruby each_with_index tries to consume all elements
<ilikeorangutans>
but if i run without each_with_index, it works just as expected
<ilikeorangutans>
can someone confirm that what i'm seeing?
<ilikeorangutans>
interestingly enough with_index works just as expected
<lopex>
and what about each_cons and the like ?
<ilikeorangutans>
haven't tested those; just stumbled over the issue with each_with_index because i was using it
<ilikeorangutans>
quick test shows each_cons seems fine
<ilikeorangutans>
in general there's something very funky with lazy enumerators:
<ilikeorangutans>
a = [[1, 2], [2, 3]]
<ilikeorangutans>
a.lazy.map { |x| x}.to_a
<ilikeorangutans>
on mri returns: => [[1], [2]]
<ilikeorangutans>
as you would expec .map { |x| x } to be the identity function