We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c54569a commit af77b3aCopy full SHA for af77b3a
src/iter.fnk
@@ -66,19 +66,18 @@ unique = fn iterable: new Set iterable
66
67
drop = fn num_items: fn items:
68
pipe items:
69
- map item, idx=0: ([item, idx], idx + 1)
70
- # TODO: should loxia add an accu to filter?
71
- filter [, idx]: idx >= num_items
72
- map [item]: item
+ filter , idx=0:
+ (idx >= num_items, idx + 1)
73
74
75
take = fn num_items: fn items:
76
- iter = items.(Symbol.iterator) _
77
- pipe count 0:
78
- while ctr: ctr < num_items
79
- map ctr: iter.next _
80
- while {done}: done == false
81
- map {value}: value
+ match num_items:
+ 0:
+ []
+ else:
+ pipe items:
+ until , ctr=1:
+ (ctr >= num_items, ctr + 1)
82
83
84
slice = fn start, end=max_int: fn items:
0 commit comments