Skip to content

Commit 6a25876

Browse files
committed
Updated Aphid list function names.
1 parent c07933a commit 6a25876

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Components.Aphid/Library/List.alx

+12-6
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@
1414

1515
l.contains = @(item) __list.contains(l, item);
1616

17-
l.map = @(mapping) {
17+
l.select = @(selector) {
1818
x = [];
19-
for (y in l) __list.add(x, mapping(y));
19+
for (y in l) __list.add(x, selector(y));
2020
ret x;
2121
};
2222

23-
l.filter = @(predicate) {
23+
l.where = @(predicate) {
2424
x = [];
2525
for (y in l) if (predicate(y)) __list.add(x, y);
2626
ret x;
2727
};
2828

2929
l.first = @(predicate) for (x in l) if (predicate(x)) ret x;;
3030

31-
l.collect = @(fan) {
31+
l.selectMany = @(selector) {
3232
x = [];
33-
for (y in l) for (z in fan(y)) x.add(z);
33+
for (y in l) for (z in selector(y)) x.add(z);
3434
ret x;
3535
};
3636

@@ -82,7 +82,7 @@
8282
ret x;
8383
};
8484

85-
l.aggr = @(acc) {
85+
l.aggregate = @(acc) {
8686
if (l.count() == 1) ret l[0];
8787
else {
8888
s = l[0];
@@ -93,5 +93,11 @@
9393

9494
l.addAll = @() l.aggr(@(x, y)x + y);
9595

96+
l.clone = @() {
97+
x = [];
98+
l.iter(x.add);
99+
ret x;
100+
};
101+
96102
ret l;
97103
};

0 commit comments

Comments
 (0)