Mercurial > repos > rhope
comparison functional.rhope @ 76:004f0fc8941f
Fix list implementation
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 07 Jul 2010 00:36:59 -0400 |
parents | 0083b2f7b3c7 |
children | 6d41b71f1b77 |
comparison
equal
deleted
inserted
replaced
75:0083b2f7b3c7 | 76:004f0fc8941f |
---|---|
1 | 1 |
2 _Fold[list,index,current,worker:out] | 2 _Fold[list,index,current,worker:out] |
3 { | 3 { |
4 Print["_Fold"] | |
5 { Print[index] | |
6 { | |
7 newval <- [worker]Call[current, [list]Index[index], index] | 4 newval <- [worker]Call[current, [list]Index[index], index] |
8 | 5 |
9 [list]Next[index] | 6 [list]Next[index] |
10 { | 7 { |
11 out <- _Fold[list, ~, newval, worker] | 8 out <- _Fold[list, ~, newval, worker] |
12 }{ | 9 }{ |
13 out <- Val[newval] | 10 out <- Val[newval] |
14 } | 11 } |
15 }} | |
16 } | 12 } |
17 | 13 |
18 Fold[worker,start,list:out] | 14 Fold[worker,start,list:out] |
19 { | 15 { |
20 Print["Fold"] | |
21 [list]First | 16 [list]First |
22 { | 17 { |
23 Print["Got first"] | |
24 out <- _Fold[list, ~, start, worker] | 18 out <- _Fold[list, ~, start, worker] |
25 }{ | 19 }{ |
26 Print["no first"] | |
27 out <- start | 20 out <- start |
28 } | 21 } |
29 } | 22 } |
30 | 23 |