annotate list.rhope @ 100:f51c4c17457c

Broken port of parser to compiler
author Mike Pavone <pavone@retrodev.com>
date Mon, 09 Aug 2010 02:03:57 -0400
parents fa437d23bb24
children f4fc0a98088a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
2 Blueprint List Leaf
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
3 {
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
4 Buffer
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
5 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
6
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
7 Index@List Leaf[list,index:out,not found]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
8 {
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
9 out, not found <- [[list]Buffer >>]Index[index]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
10 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
11
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
12 Set@List Leaf[list,index,value:out,invalid index]
70
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
13 {
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
14 If[[index] < [0]]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
15 {
96
5a08705f7610 Semi-broken cleanup of Array implementation
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
16 rev index <- [[[list]Buffer >>]Length]+[index]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
17 invalid index <- If[[rev index] < [0]] {}
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
18 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
19 out,invalid index <- [list]Set[rev index, value]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
20 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
21
70
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
22 }{
96
5a08705f7610 Semi-broken cleanup of Array implementation
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
23 len <- [[list]Buffer >>]Length
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
24 If[[index] > [len]]
70
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
25 {
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
26 makeleft <- Yes
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
27 }{
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
28 If[[[index] > [7]] And [[index] >= [len]]]
70
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
29 {
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
30 makeleft <- Yes
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
31 }{
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
32 out <- [list]Buffer <<[ [[list]Buffer >>]Set[index, value] ]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
33 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
34 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
35 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
36
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
37 Val[makeleft]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
38 {
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
39 out <- [[[[[[Build[List()]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
40 ]Buffer << [[Array[]]Append[value]]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
41 ]Left << [list]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
42 ]Right << [List[]]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
43 ]Offset << [index]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
44 ]Right Offset <<[[index]+[8i32]]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
45 ]Length << [ [[list]Length]+[1] ]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
46 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
47 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
48
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
49 _Right Set@List Leaf[list,index,val:out,didn't set]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
50 {
96
5a08705f7610 Semi-broken cleanup of Array implementation
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
51 len <- [[list]Buffer >>]Length
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
52 do it <- If[[index] < [len]] {}
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
53 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
54 ,didn't set <- If[[index]=[len]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
55 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
56 didn't set,do it <- If[[index]>[7]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
57 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
58 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
59 Val[do it]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
60 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
61 out <- [list]Set[index,val]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
62 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
63 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
64
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
65 Length@List Leaf[list:out]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
66 {
96
5a08705f7610 Semi-broken cleanup of Array implementation
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
67 out <- [[list]Buffer >>]Length
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
68 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
69
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
70 Last@List Leaf[list:out,none]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
71 {
96
5a08705f7610 Semi-broken cleanup of Array implementation
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
72 len <- [[list]Buffer >>]Length
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
73 ,none <-If[len]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
74 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
75 out <- [len]-[1]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
76 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
77 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
78
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
79 Append@List Leaf[list,val:out]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
80 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
81 [list]Last
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
82 { index <- [~]+[1] }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
83 { index <- 0 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
84 out <- [list]Set[index, val]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
85 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
86
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
87 First@List Leaf[list:out,none]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
88 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
89 [[list]Buffer >>]Index[0]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
90 { out <- 0 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
91 { none <- Yes }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
92 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
93
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
94 Next@List Leaf[list,index:next,none]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
95 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
96 pos next <- [index]+[1]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
97 ,none <- If[[pos next] < [[list]Length]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
98 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
99 next <- Val[pos next]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
100 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
101 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
102
70
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
103 Blueprint List
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
104 {
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
105 Buffer
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
106 Left
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
107 Right
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
108 Offset(Int32,Naked)
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
109 Right Offset(Int32,Naked)
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
110 Length(Int32,Naked)
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
111 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
112
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
113 List[:out(List)]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
114 {
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
115 out <- [Build[List Leaf()]]Buffer <<[Array[]]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
116 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
117
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
118 Index@List[list,index:out,not found]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
119 {
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
120 If[[index]<[[list]Offset >>]]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
121 {
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
122 out, not found <- [[list]Left >>]Index[index]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
123 }{
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
124 If[[index] < [[list]Right Offset >>]]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
125 {
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
126 out, not found <- [[list]Buffer >>]Index[[index]-[[list]Offset >>]]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
127 }{
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
128 out, not found <- [[list]Right >>]Index[[index]-[[list]Right Offset >>]]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
129 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
130 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
131 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
132
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
133 Length@List[list:out]
70
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
134 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
135 out <- [list]Length >>
70
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
136 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
137
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
138 Set@List[list,index,val:out,invalid index]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
139 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
140 If[[index] < [0]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
141 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
142 , invalid index <- [list]Last
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
143 { rev index <- [[~]+[1]]+[index] }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
144 invalid index <- If[[rev index] < [0]] {}
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
145 { out,invalid index <- [list]Set[rev index, val] }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
146
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
147 }{
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
148 If[[index]<[[list]Offset >>]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
149 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
150 lsize <- [[list]Left >>]Length
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
151 [[list]Left >>]Set[index, val]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
152 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
153 out <- [[list]Left <<[~]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
154 ]Length <<[ [[list]Length >>]+[[[~]Length]-[lsize]] ]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
155 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
156 }{
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
157
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
158 If[[index]<[[list]Right Offset >>]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
159 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
160 off index <- [index]-[[list]Offset >>]
96
5a08705f7610 Semi-broken cleanup of Array implementation
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
161 bsize <- [[list]Buffer >>]Length
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
162 If[[off index]>[bsize]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
163 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
164 If[[[list]Right >>]Length]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
165 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
166 my end <- [[list]Offset >>]+[[[list]Buffer >>]Length]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
167 nroffset <- [[[index]-[my end]]/[2]]+[my end]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
168 nright <- out <- [[[[[[Build[List()]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
169 ]Buffer << [[Array[]]Append[val]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
170 ]Left << [List[]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
171 ]Right << [[list]Right >>]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
172 ]Offset << [[index]-[nroffset]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
173 ]Right Offset <<[ [[list]Right Offset>>]-[nroffset] ]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
174 ]Length << [ [[[list]Right >>]Length]+[1] ]
70
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
175
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
176 out <- [[[list]Right <<[nright]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
177 ]Length <<[ [[list]Length >>]+[1] ]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
178 ]Right Offset <<[nroffset]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
179 }{
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
180 out <- [[[list]Right <<[ [[list]Right >>]Set[0, val] ]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
181 ]Right Offset <<[index]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
182 ]Length <<[ [[list]Length >>]+[1] ]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
183 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
184 }{
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
185 [[list]Buffer >>]Set[off index, val]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
186 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
187 out <- [[list]Buffer <<[~]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
188 ]Length <<[ [[list]Length >>]+[[[~]Length >>]-[bsize]] ]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
189 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
190 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
191 }{
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
192 rsize <- [[list]Right>>]Length
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
193 adj ind <- [index]-[[list]Right Offset>>]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
194 If[[[[list]Left>>]Length] > [rsize]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
195 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
196 [[list]Right >>]Set[adj ind, val]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
197 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
198 out <- [[list]Right <<[~]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
199 ]Length <<[ [[list]Length >>]+[[[~]Length]-[rsize]] ]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
200 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
201 }{
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
202 [[list]Right >>]_Right Set[adj ind, val]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
203 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
204 out <- [[list]Right <<[~]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
205 ]Length <<[ [[list]Length >>]+[[[~]Length]-[rsize]] ]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
206 }{
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
207 out <- [[[[[[Build[List()]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
208 ]Buffer << [[Array[]]Append[val]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
209 ]Left << [list]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
210 ]Right << [List[]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
211 ]Offset << [index]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
212 ]Right Offset <<[[index]+[8i32]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
213 ]Length << [ [[list]Length]+[1] ]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
214 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
215 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
216 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
217 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
218 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
219 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
220
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
221 _Right Set@List[list,index,val:out,didn't set]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
222 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
223 If[[[list]Right Offset >>]>[index]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
224 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
225 out <- [list]Set[index, val]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
226 }{
76
004f0fc8941f Fix list implementation
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
227 out,didn't set <- [[list]Right >>]_Right Set[[index]-[[list]Right Offset >>], val]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
228 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
229 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
230
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
231 Last@List[list:out,none]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
232 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
233 [[list]Right >>]Last
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
234 { out <- [~]+[[list]Right Offset >>] }
96
5a08705f7610 Semi-broken cleanup of Array implementation
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
235 { out <- [[[[list]Buffer >>]Length]-[1]]+[[list]Offset >>] }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
236 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
237
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
238 Append@List[list,val:out]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
239 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
240 [list]Last
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
241 { index <- [~]+[1] }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
242 { index <- 0 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
243 out <- [list]Set[index, val]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
244 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
245
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
246 First@List[list:out,none]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
247 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
248 If[[[list]Left >>]Length]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
249 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
250 out <- [[list]Left >>]First
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
251 }{
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
252 out <- [list]Offset >>
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
253 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
254 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
255
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
256 Next@List[list,index:next,none]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
257 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
258 If[[index] < [[[list]Offset >>]-[1]]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
259 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
260 next <- [[list]Left >>]Next[index] {}
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
261 { next <- Offset >>[list] }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
262 }{
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
263 If[[index] < [[list]Right Offset >>]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
264 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
265 pos next <- [index]+[1]
96
5a08705f7610 Semi-broken cleanup of Array implementation
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
266 If[[pos next] < [[[[list]Buffer >>]Length]+[[list]Offset >>]]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
267 {
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
268 next <- Val[pos next]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
269 }{
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
270 ,none <- [[list]Right >>]First
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
271 { next <- [~]+[[list]Right Offset >>] }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
272 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
273 }{
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
274 ,none <- [[list]Right >>]Next[[index]-[[list]Right Offset >>]]
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
275 { next <- [~]+[[list]Right Offset >>] }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
276 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
277 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
278 }
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.
Mike Pavone <pavone@retrodev.com>
parents: 70
diff changeset
279
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
280 New Like@List[in:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
281 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
282 out <- List[]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
283 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
284
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
285 New Like@List Leaf[in:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
286 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
287 out <- List[]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
288 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
289
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
290 //TODO: Implement a more efficent version of this
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
291 _Tail[list, cur, dest:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
292 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
293 ndest <- [dest]Append[[list]Index[cur]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
294 [list]Next[cur]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
295 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
296 out <- _Tail[list, ~, ndest]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
297 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
298 out <- Val[ndest]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
299 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
300 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
301 Tail[list,start:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
302 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
303 newlist <- New Like[list]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
304 [list]Index[start]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
305 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
306 out <- _Tail[list, start, newlist]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
307 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
308 out <- Val[newlist]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
309 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
310 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
311
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
312 Concatenate[left,right:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
313 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
314 out <- Fold[Append[?], left, right]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
315 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
316
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
317 Print@List Leaf[list:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
318 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
319 If[[[list]Buffer >>]Length]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
320 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
321 Print["List"]
97
fa437d23bb24 fix memory corruption bug
Mike Pavone <pavone@retrodev.com>
parents: 96
diff changeset
322 { out <- _Print Seq[list, [list]First] }
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
323 }{
97
fa437d23bb24 fix memory corruption bug
Mike Pavone <pavone@retrodev.com>
parents: 96
diff changeset
324 out <- Print["List\n\t{Empty}"]
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
325 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
326 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
327
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
328 Print@List[list:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
329 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
330 Print["List"]
97
fa437d23bb24 fix memory corruption bug
Mike Pavone <pavone@retrodev.com>
parents: 96
diff changeset
331 { out <- _Print Seq[list, [list]First] }
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
332 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
333
100
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
334
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
335 Peek@List[list:out,empty]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
336 {
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
337 [list]Last
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
338 {
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
339 out <- [list]Index[~]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
340 }{
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
341 empty <- list
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
342 }
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
343 }
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
344
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
345 Peek@List Leaf[list:out,empty]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
346 {
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
347 [list]Last
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
348 {
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
349 out <- [list]Index[~]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
350 }{
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
351 empty <- list
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
352 }
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
353 }
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
354
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
355