Hello, the following code doesnt compile. Is it a bug? Or am i doin sth wrong?
import future
(lc[i | (i<-0..9), int]).filterIt(it < 3).echo;
On the other hand this does compile :O
@[1,2,3,4,5,6].cycle(2).filterIt(it < 5).cycle(2).filterIt(it > 1).echo
Thanks :)
the lc needs to be converted to an openArray before filterIt gets it. I was trying toSeq or items neither of which worked, but cycle(1) does the trick. It's probably a bug; lc seems to need work judging by the issues list for it. FYI future is being renamed to sugar on devel.
(lc[i | (i<-0..9), int]).cycle(1).filterIt(it < 3).echo;
You can just filter in the list comprehension
import future
echo (lc[i | (i<-0..9, i < 3), int])
Thank you very much guys :)
@juancarlospaco @ggibson that were pretty much the answers i needed
@mratsim i know, but im playin arround and trying beginner things. Btw arraymancer is nice :)