Changeset 2063
- Timestamp:
- Aug 24, 2006, 8:35:55 PM (14 years ago)
- Location:
- to-imperative/trunk/library/List/refal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
to-imperative/trunk/library/List/refal/List.rf
r2044 r2063 14 14 Paren-Term term = (term); 15 15 16 Id e1 = e1; 17 18 Append (e1) e2 = e2 e1; 19 16 20 Zip (e.list1) (e.list2) = 17 21 (e.list1) (e.list2) /*empty*/ $iter { … … 27 31 e.list : t.item e.rest = 28 32 (e.new-list <Apply s.Fname e.Fargs t.item>) e.rest; 33 } :: (e.new-list) e.list, 34 e.list : /*empty*/ = 35 e.new-list; 36 37 Map! s.Fname e.Fargs (e.list) = 38 () e.list $iter { 39 e.list : (e.item) e.rest = 40 (e.new-list (<Apply s.Fname e.Fargs e.item>)) e.rest; 29 41 } :: (e.new-list) e.list, 30 42 e.list : /*empty*/ = … … 55 67 Elem? e.list t.item = 56 68 e.list : e t.item e; 57 58 Get-Elem s.num (e.list) = <L s.num e.list>;59 69 60 70 Foldr s.Fname e.Fargs (e.value) (e.list) = … … 113 123 * Returns number of e.expr entries in e.source and e.source without all e.expr's. 114 124 */ 115 Entries e.expr (e.source) =116 0 e.source () $iter {117 e.source : e1 e.expr e2 = <"+" s.num 1> e2 (e.res e1);118 s.num (e.res e.source);119 } :: s.num e.source (e.res),120 e.source : /*empty*/ =121 s.num e.res;125 //Entries e.expr (e.source) = 126 // 0 e.source () $iter { 127 // e.source : e1 e.expr e2 = <"+" s.num 1> e2 (e.res e1); 128 // s.num (e.res e.source); 129 // } :: s.num e.source (e.res), 130 // e.source : /*empty*/ = 131 // s.num e.res; 122 132 123 133 /* -
to-imperative/trunk/library/List/refal/List.rfi
r2037 r2063 3 3 // $Date$ 4 4 5 $func Id e1 = e1; 6 7 $func Append (e1) e2 = e2e1; 8 5 9 $func Zip (e.list1) (e.list2) = e.new-list; 6 10 7 $func Map s.Fname e.Fargs (e.list) = e.new-list; 11 $func? Map s.Fname e.Fargs (e.list) = e.new-list; 12 13 $func? Map! s.Fname e.Fargs (e.list) = e.new-list; 8 14 9 15 $func Filter s.Fname e.Fargs (e.list) = e.new-list; … … 12 18 13 19 $func? Elem? e.list t.item = ; 14 15 $func Get-Elem s.num (e.list) = term;16 20 17 21 $func Foldr s.Fname e.Fargs (e.value) (e.list) = e.value; … … 32 36 33 37 // Returns number of e.expr entries in e.source and e.source without all e.expr's. 34 $func Entries e.expr (e.source) = s.num e.res; 38 // FIXME: Strange function! 39 // Additionally it conflicts with Table.Entries. 40 // Commented out at least until there is some sort of name conflicts resolution 41 // strategy. 42 // $func Entries e.expr (e.source) = s.num e.res; 35 43 36 44 // Add to the first list all new elements from the second one.
Note: See TracChangeset
for help on using the changeset viewer.