ngs-lang / ngs

Next Generation Shell (NGS)
https://ngs-lang.org/
GNU General Public License v3.0
1.45k stars 41 forks source link

implementing skip(Iter, Any) #600

Closed antonio-pedro99 closed 1 year ago

antonio-pedro99 commented 1 year ago

Issue: #597

The logic seems correct, I have tested in a local function and is working fine, but wonderly, the method .Arr() is always return an empty array.

E.g

i = [3, 4, 25, 10].Iter() #my `iterator`
pattern = F(x) x <  10
for e in i {
    if e =~ pattern i.next()
}
echo(i.Arr()) # is printing an empty array. Why?

the result should be 25, 10