comparison functional.rhope @ 75:0083b2f7b3c7

Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
author Mike Pavone <pavone@retrodev.com>
date Tue, 06 Jul 2010 07:52:59 -0400
parents
children 004f0fc8941f
comparison
equal deleted inserted replaced
74:a844c623c7df 75:0083b2f7b3c7
1
2 _Fold[list,index,current,worker:out]
3 {
4 Print["_Fold"]
5 { Print[index]
6 {
7 newval <- [worker]Call[current, [list]Index[index], index]
8
9 [list]Next[index]
10 {
11 out <- _Fold[list, ~, newval, worker]
12 }{
13 out <- Val[newval]
14 }
15 }}
16 }
17
18 Fold[worker,start,list:out]
19 {
20 Print["Fold"]
21 [list]First
22 {
23 Print["Got first"]
24 out <- _Fold[list, ~, start, worker]
25 }{
26 Print["no first"]
27 out <- start
28 }
29 }
30