1 | // $Id: List.rfi 3964 2008-10-09 17:57:49Z yura $ |
---|
2 | |
---|
3 | $module "refal.plus.List"; |
---|
4 | |
---|
5 | $func Id e.expr = e.expr; |
---|
6 | |
---|
7 | $func Append (e.expr1) e.expr2 = e.expr2expr1; |
---|
8 | |
---|
9 | $func Zip (e.list1) (e.list2) = e.list; |
---|
10 | |
---|
11 | $func? Map s.func e.funcArgs (e.list) = e.list; |
---|
12 | |
---|
13 | $func? MapIn s.func e.funcArgs (e.list) = e.list; |
---|
14 | |
---|
15 | $func Filter s.func e.funcArgs (e.list) = e.list; |
---|
16 | |
---|
17 | $func Split s.func e.funcArgs (e.list) = (e.trueList) (e.falseList); |
---|
18 | |
---|
19 | $func? IsElem e.list t.item = ; |
---|
20 | |
---|
21 | $func Foldr s.func e.funcArgs (e.value) (e.list) = e.value; |
---|
22 | |
---|
23 | $func Foldr1 s.func e.funcArgs (e.list) = e.value; |
---|
24 | |
---|
25 | $func? All s.func e.funcArgs (e.list) = ; |
---|
26 | |
---|
27 | $func? Any s.func e.funcArgs (e.list) = ; |
---|
28 | |
---|
29 | $func Concat e.lists = e.list; |
---|
30 | |
---|
31 | $func Paren e.exprs = e.lists; |
---|
32 | |
---|
33 | $func Reverse e.list = e.list; |
---|
34 | |
---|
35 | $func Intersperse (e.sep) e.list = e.list; |
---|
36 | |
---|
37 | $func Separate (e.sep) e.list = e.listOfLists; |
---|
38 | |
---|
39 | $func Nub e.list = e.list; |
---|
40 | |
---|
41 | $func Replicate s.n e.expr = e.list; |
---|
42 | |
---|
43 | $func QSort e.list = e.list; |
---|
44 | |
---|
45 | // Returns number of e.expr entries in e.source and e.source without all e.expr's. |
---|
46 | // FIXME: Strange function! |
---|
47 | // Additionally it conflicts with Table.Entries. |
---|
48 | // Commented out at least until there is some sort of name conflicts resolution |
---|
49 | // strategy. |
---|
50 | // $func Entries e.expr (e.source) = s.num e.res; |
---|
51 | |
---|
52 | // Add to the first list all new elements from the second one. |
---|
53 | $func Or (e.list1) e.list2 = e.list; |
---|
54 | |
---|
55 | // Choose from the first list all elements present in the second one. |
---|
56 | $func And (e.list1) e.list2 = e.list; |
---|
57 | |
---|
58 | // Choose from the first list all elements not present in the second one. |
---|
59 | $func Sub (e.list1) e.list2 = e.list; |
---|