annotate list.rhope @ 189:d0e3a13c1bd9 default tip

Remove old calculator example
author Mike Pavone <pavone@retrodev.com>
date Fri, 07 Oct 2011 00:24:04 -0700
parents c40e0faa1c92
children
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
150
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
103 Previous@List Leaf[list,index:prev,none]
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
104 {
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
105 ,none <- If[[index]>[0]]
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
106 { prev <- [index]-[1] }
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
107 }
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
108
70
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
109 Blueprint List
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
110 {
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
111 Buffer
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
112 Left
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
113 Right
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
114 Offset(Int32,Naked)
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
115 Right Offset(Int32,Naked)
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
116 Length(Int32,Naked)
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
172
926b56a43f47 Fix some bugs related to inlining
Mike Pavone <pavone@retrodev.com>
parents: 150
diff changeset
119 List[:out(List Leaf)]
70
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
120 {
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
121 out <- [Build[List Leaf()]]Buffer <<[Array[]]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
122 }
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 Index@List[list,index:out,not found]
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 If[[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]Left >>]Index[index]
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 If[[index] < [[list]Right Offset >>]]
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 out, not found <- [[list]Buffer >>]Index[[index]-[[list]Offset >>]]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
133 }{
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
134 out, not found <- [[list]Right >>]Index[[index]-[[list]Right Offset >>]]
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
135 }
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 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
138
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
139 Length@List[list:out]
70
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
140 {
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
141 out <- [list]Length >>
70
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
142 }
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
143
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
144 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
145 {
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 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
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 , 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
149 { 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
150 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
151 { 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
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 }{
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 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
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 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
157 [[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
158 {
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 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
160 ]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
161 }
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 }{
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[[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
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 off index <- [index]-[[list]Offset >>]
96
5a08705f7610 Semi-broken cleanup of Array implementation
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
167 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
168 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
169 {
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 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
171 {
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 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
173 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
174 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
175 ]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
176 ]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
177 ]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
178 ]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
179 ]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
180 ]Length << [ [[[list]Right >>]Length]+[1] ]
70
1bfcf5f8fa69 Beginning of List implementation
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
181
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
182 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
183 ]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
184 ]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
185 }{
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 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
187 ]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
188 ]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
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 [[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
192 {
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 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
194 ]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
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 }
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 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
199 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
200 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
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 >>]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 }{
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 [[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
209 {
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 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
211 ]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
212 }{
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 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
214 ]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
215 ]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
216 ]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
217 ]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
218 ]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
219 ]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
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 }
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 }
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 }
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
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
227 _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
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 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
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 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
232 }{
101
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
233 ,didn't set <- [[list]Right >>]_Right Set[[index]-[[list]Right Offset >>], val]
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
234 { out <- [list]Right <<[~] }
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
235 }
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 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
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]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
241 { out <- [~]+[[list]Right Offset >>] }
96
5a08705f7610 Semi-broken cleanup of Array implementation
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
242 { 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
243 }
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 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
246 {
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 [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
248 { 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
249 { 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
250 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
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
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 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
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 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
256 {
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 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
258 }{
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 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
260 }
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 }
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 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
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 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
266 {
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 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
268 { 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
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 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
271 {
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 pos next <- [index]+[1]
96
5a08705f7610 Semi-broken cleanup of Array implementation
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
273 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
274 {
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 <- 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
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 ,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
278 { 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
279 }
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
280 }{
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
281 ,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
282 { 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
283 }
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
284 }
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
285 }
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
286
150
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
287 Previous@List[list,index:prev,none]
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
288 {
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
289 If[[index] <= [[list]Offset >>]]
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
290 {
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
291 prev,none <- [[list]Left >>]Previous[index]
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
292 }{
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
293 If[[index] <= [[list]Right Offset >>]]
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
294 {
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
295 pos prev <- [index]-[1]
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
296 If[[pos prev] < [[[[list]Buffer >>]Length]+[[list]Offset >>]]]
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
297 { prev <- Val[pos prev] }
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
298 { prev <- [[[[list]Buffer >>]Length]+[[list]Offset >>]]-[1] }
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
299 }{
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
300 [[list]Right >>]Previous[[index]-[[list]Right Offset >>]]
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
301 { prev <- [~]+[[list]Right Offset >>] }
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
302 { prev <- [[[[list]Buffer >>]Length]+[[list]Offset >>]]-[1] }
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
303 }
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
304 }
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
305 }
50c97b448f44 Add Previous method to List
Mike Pavone <pavone@retrodev.com>
parents: 130
diff changeset
306
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
307 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
308 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
309 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
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 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
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 <- List[]
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 //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
318 _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
319 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
320 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
321 [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
322 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
323 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
324 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
325 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
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 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
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 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
331 [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
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 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
334 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
335 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
336 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
337 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
338
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
339 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
340 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
341 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
342 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
343
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
344 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
345 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
346 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
347 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
348 Print["List"]
97
fa437d23bb24 fix memory corruption bug
Mike Pavone <pavone@retrodev.com>
parents: 96
diff changeset
349 { 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
350 }{
97
fa437d23bb24 fix memory corruption bug
Mike Pavone <pavone@retrodev.com>
parents: 96
diff changeset
351 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
352 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
353 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
354
130
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
355 _String Seq[text,val,key:out]
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
356 {
179
64be565a40c6 Implement If method on List, fix Get Char to handle end of file, fix nested list pretty printing
Mike Pavone <pavone@retrodev.com>
parents: 172
diff changeset
357 out <- [text]Append[ [[["\n\t"]Append[String[key]]]Append[":\t"]]Append[ [[String[val]]Split["\n"]]Join["\n\t"] ] ]
130
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
358 }
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
359
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
360 String@List Leaf[list:out]
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
361 {
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
362 If[[[list]Buffer >>]Length]
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
363 {
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
364 out <- Fold[_String Seq[?], "List", list]
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
365 }{
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
366 out <- "List\n\t{Empty}"
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
367 }
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
368 }
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
369
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
370 String@List[list:out]
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
371 {
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
372 out <- Fold[_String Seq[?], "List", list]
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
373 }
147dfc703161 Add String method to List
Mike Pavone <pavone@retrodev.com>
parents: 101
diff changeset
374
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
375 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
376 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
377 Print["List"]
97
fa437d23bb24 fix memory corruption bug
Mike Pavone <pavone@retrodev.com>
parents: 96
diff changeset
378 { 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
379 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 76
diff changeset
380
179
64be565a40c6 Implement If method on List, fix Get Char to handle end of file, fix nested list pretty printing
Mike Pavone <pavone@retrodev.com>
parents: 172
diff changeset
381 If@List Leaf[list:yep,nope]
64be565a40c6 Implement If method on List, fix Get Char to handle end of file, fix nested list pretty printing
Mike Pavone <pavone@retrodev.com>
parents: 172
diff changeset
382 {
64be565a40c6 Implement If method on List, fix Get Char to handle end of file, fix nested list pretty printing
Mike Pavone <pavone@retrodev.com>
parents: 172
diff changeset
383 yep,nope <- If[[[list]Buffer >>]Length]
64be565a40c6 Implement If method on List, fix Get Char to handle end of file, fix nested list pretty printing
Mike Pavone <pavone@retrodev.com>
parents: 172
diff changeset
384 }
64be565a40c6 Implement If method on List, fix Get Char to handle end of file, fix nested list pretty printing
Mike Pavone <pavone@retrodev.com>
parents: 172
diff changeset
385
64be565a40c6 Implement If method on List, fix Get Char to handle end of file, fix nested list pretty printing
Mike Pavone <pavone@retrodev.com>
parents: 172
diff changeset
386 If@List[list:yep,nope]
64be565a40c6 Implement If method on List, fix Get Char to handle end of file, fix nested list pretty printing
Mike Pavone <pavone@retrodev.com>
parents: 172
diff changeset
387 {
64be565a40c6 Implement If method on List, fix Get Char to handle end of file, fix nested list pretty printing
Mike Pavone <pavone@retrodev.com>
parents: 172
diff changeset
388 yep,nope <- If[[list]Length >>]
64be565a40c6 Implement If method on List, fix Get Char to handle end of file, fix nested list pretty printing
Mike Pavone <pavone@retrodev.com>
parents: 172
diff changeset
389 }
100
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
390
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
391 Peek@List[list:out,empty]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
392 {
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
393 [list]Last
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
394 {
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
395 out <- [list]Index[~]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
396 }{
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
397 empty <- list
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
398 }
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
399 }
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
400
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
401 Peek@List Leaf[list:out,empty]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
402 {
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
403 [list]Last
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
404 {
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
405 out <- [list]Index[~]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
406 }{
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
407 empty <- list
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
408 }
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
409 }
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
410
101
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
411 _Check Present[check in,val,index:out]
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
412 {
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
413 [check in]Index[index]
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
414 {
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
415 If[[~]=[val]]
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
416 { out <- No }
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
417 { out <- Yes }
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
418 }{
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
419 out <- Yes
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
420 }
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
421 }
100
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 97
diff changeset
422
101
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
423 _=List[a,b:out]
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
424 {
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
425 ,out <- If[[[a]Length]=[[b]Length]]
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
426 {
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
427 [a]Find[_Check Present[b,?]]
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
428 {
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
429 out <- No
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
430 }{
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
431 out <- Yes
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
432 }
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
433 }
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
434 }
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
435
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
436 =@List Leaf[a,b:out]
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
437 {
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
438 out <- _=List[a,b]
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
439 }
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
440
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
441 =@List[a,b:out]
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
442 {
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
443 out <- _=List[a,b]
f4fc0a98088a Fixed some bugs that were preventing compiled compiler from working correctly. Need to address memory usage
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
444 }
180
c40e0faa1c92 Add Call to Dict and List
Mike Pavone <pavone@retrodev.com>
parents: 179
diff changeset
445
c40e0faa1c92 Add Call to Dict and List
Mike Pavone <pavone@retrodev.com>
parents: 179
diff changeset
446 Call@List[list,index:out,notfound]
c40e0faa1c92 Add Call to Dict and List
Mike Pavone <pavone@retrodev.com>
parents: 179
diff changeset
447 {
c40e0faa1c92 Add Call to Dict and List
Mike Pavone <pavone@retrodev.com>
parents: 179
diff changeset
448 out,notfound <- [list]Index[index]
c40e0faa1c92 Add Call to Dict and List
Mike Pavone <pavone@retrodev.com>
parents: 179
diff changeset
449 }
c40e0faa1c92 Add Call to Dict and List
Mike Pavone <pavone@retrodev.com>
parents: 179
diff changeset
450
c40e0faa1c92 Add Call to Dict and List
Mike Pavone <pavone@retrodev.com>
parents: 179
diff changeset
451 Call@List Leaf[list,index:out,notfound]
c40e0faa1c92 Add Call to Dict and List
Mike Pavone <pavone@retrodev.com>
parents: 179
diff changeset
452 {
c40e0faa1c92 Add Call to Dict and List
Mike Pavone <pavone@retrodev.com>
parents: 179
diff changeset
453 out,notfound <- [list]Index[index]
c40e0faa1c92 Add Call to Dict and List
Mike Pavone <pavone@retrodev.com>
parents: 179
diff changeset
454 }
c40e0faa1c92 Add Call to Dict and List
Mike Pavone <pavone@retrodev.com>
parents: 179
diff changeset
455