Test on iterator filter and map
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
ds={
|
||||
"init":func(end){@end=end; @current=0 but true},
|
||||
"current":func(){current},
|
||||
"next":func(){
|
||||
((next=current+1) <= end) ? [true] {@current=next but current} :: {nil}
|
||||
}
|
||||
, "filter":func(item,index) { item > 0 }
|
||||
, "map": func(item,index) { item * 2 }
|
||||
}
|
||||
|
||||
/* Example
|
||||
;
|
||||
it=$(ds,3);
|
||||
add(it)
|
||||
*/
|
||||
Reference in New Issue
Block a user