annotate array.rhope @ 109:b7df624895b2

Hack to reduce overhead of Escape Rhope Name
author Mike Pavone <pavone@retrodev.com>
date Wed, 06 Oct 2010 23:47:26 +0000
parents 2f6f0867fd68
children 43cc42df26cc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
102
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
2 Blueprint Array
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
3 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
4 Eltype(Blueprint)
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
5 Length(Int32,Naked)
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
6 Storage(Int32,Naked)
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
7 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
8
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
9 Blueprint Boxed Array
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
10 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
11 Length(Int32,Naked)
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
12 Storage(Int32,Naked)
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
13 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
14
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
15 Blueprint Empty Array
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
16 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
17 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
18
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
19 Foreign C:runtime
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
20 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
21 _internal_array_copyout[array(Array), index(Int32,Naked), dest(Any Type,Boxed,Mutable):dest]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
22 _internal_array_copyin[array(Array,Boxed,Mutable), index(Int32,Naked), val:array]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
23 _internal_array_getboxed[array(Boxed Array), index(Int32,Naked):out]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
24 _internal_array_setboxed[array(Boxed Array,Boxed,Mutable), index(Int32,Naked), val:array]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
25 _internal_array_allocboxed[size(Int32,Naked):out(Boxed Array)]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
26 _internal_array_allocboxedcopy[source(Boxed Array),size(Int32,Naked):out(Boxed Array)]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
27 _internal_array_allocnaked[size(Int32,Naked),type(Blueprint):out(Array)]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
28 _internal_array_allocnakedcopy[source(Array),size(Int32,Naked):out(Array)]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
29 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
30
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
31 Array[:out(Empty Array)]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
32 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
33 out <- Build[Empty Array()]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
34 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
35
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
36 First@Empty Array[array:out,empty]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
37 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
38 empty <- array
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
39 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
40
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
41 First@Array[array:out(Int32),empty]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
42 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
43 ,empty <- If[[array]Length >>]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
44 { out <- 0 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
45 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
46
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
47 First@Boxed Array[array:out(Int32),empty]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
48 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
49 ,empty <- If[[array]Length >>]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
50 { out <- 0 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
51 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
52
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
53 Next@Empty Array[array:out,empty]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
54 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
55 empty <- array
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
56 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
57
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
58 Next@Array[array,current:out(Int32),empty]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
59 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
60 next <- [current]+[1]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
61 ,empty <- If[[next] < [[array]Length >>]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
62 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
63 out <- Val[next]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
64 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
65 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
66
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
67 Next@Boxed Array[array,current:out(Int32),empty]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
68 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
69 next <- [current]+[1]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
70 ,empty <- If[[next] < [[array]Length >>]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
71 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
72 out <- Val[next]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
73 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
74 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
75
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
76 Last@Empty Array[array:out,empty]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
77 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
78 empty <- array
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
79 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
80
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
81 Last@Array[array:out(Int32),empty]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
82 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
83 ,empty <- If[[array]Length >>]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
84 { out <- [[array]Length >>] - [1] }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
85 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
86
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
87 Last@Boxed Array[array:out(Int32),empty]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
88 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
89 ,empty <- If[[array]Length >>]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
90 { out <- [[array]Length >>] - [1] }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
91 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
92
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
93 Append@Empty Array[array,newval:out(Array)]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
94 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
95 out <- [array]Set[0, newval]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
96 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
97
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
98 Append@Array[array,newval:out]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
99 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
100 out <- [array]Set[[array]Length >>, newval]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
101 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
102
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
103 Append@Boxed Array[array,newval:out(Boxed Array)]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
104 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
105 out <- [array]Set[[array]Length >>, newval]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
106 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
107
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
108 Index@Empty Array[array:out,notfound]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
109 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
110 notfound <- array
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
111 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
112
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
113 Index@Array[array,index(Int32):out,notfound]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
114 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
115 ,notfound <- If[[index] >= [0]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
116 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
117 ,notfound <- If[[index] < [[array]Length >>]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
118 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
119 out <- _internal_array_copyout[array, index, Build[[array]Eltype >>]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
120 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
121 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
122 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
123
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
124 Index@Boxed Array[array,index(Int32):out,notfound]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
125 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
126 ,notfound <- If[[index] >= [0]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
127 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
128 ,notfound <- If[[index] < [[array]Length >>]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
129 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
130 out <- _internal_array_getboxed[array, index]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
131 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
132 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
133 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
134
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
135 _Copy to Boxed[source,dest,current:out]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
136 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
137 ndest <- _internal_array_setboxed[dest, current, [source]Index[current]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
138
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
139 [source]Next[current]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
140 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
141 out <- _Copy to Boxed[source, ndest, ~]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
142 }{
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
143 out <- Val[ndest]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
144 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
145 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
146
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
147 _Copy Naked[source,dest,current:out]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
148 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
149 ndest <- _internal_array_copyin[dest, current, [source]Index[current]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
150
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
151 [source]Next[current]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
152 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
153 out <- _Copy Naked[source, ndest, ~]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
154 }{
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
155 out <- Val[ndest]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
156 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
157 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
158
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
159 Set@Array[array,index(Int32),val:out,invalid]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
160 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
161 invalid <- If[[index]<[0]] {}
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
162 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
163 len <- [array]Length >>
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
164 If[[index]>[len]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
165 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
166 out <- [[array]Set[[index]-[1],val]]Set[index, val]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
167 }{
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
168 If[[Blueprint Of[val]]=[[array]Eltype >>]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
169 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
170 If[[index]<[[array]Storage >>]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
171 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
172 out <- [_internal_array_copyin[array, index, val]]Length <<[Max[len, [index]+[1]]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
173 }{
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
174 //Does this make sense given the copies we may have to make?
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
175 If[[index] < [4]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
176 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
177 new storage <- [index]+[index]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
178 }{
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
179 new storage <- [index]+[[index]RShift[1]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
180 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
181 out <- [_internal_array_copyin[_internal_array_allocnakedcopy[array, new storage], index, val]]Length <<[[index]+[1]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
182 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
183 }{
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
184 out <-[[_Copy to Boxed[array, _internal_array_allocboxed[[array]Storage >>], [array]First]]Length <<[[array]Length >>]]Set[index, val]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
185 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
186 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
187 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
188 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
189
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
190 Set@Boxed Array[array,index(Int32),val:out(Boxed Array),invalid]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
191 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
192 invalid <- If[[index]<[0]] {}
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
193 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
194 len <- [array]Length >>
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
195 If[[index]>[len]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
196 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
197 out <- [[array]Set[[index]-[1],val]]Set[index, val]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
198 }{
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
199 If[[index]<[[array]Storage >>]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
200 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
201 out <- [_internal_array_setboxed[array, index, val]]Length <<[Max[len, [index]+[1]]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
202 }{
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
203 //Does this make sense given the copies we may have to make?
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
204 If[[index] < [4]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
205 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
206 new storage <- [index]+[index]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
207 }{
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
208 new storage <- [index]+[[index]RShift[1]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
209 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
210 out <- [_internal_array_setboxed[_internal_array_allocboxedcopy[array, new storage], index, val]]Length <<[[index]+[1]]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
211 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
212 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
213 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
214 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
215
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
216 Set@Empty Array[array,index(Int32),val:out(Array),invalid]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
217 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
218 invalid <- If[[index]<[0]] {}
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
219 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
220 out <- [_internal_array_allocnaked[1, Blueprint Of[val]]]Set[index, val]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
221 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
222 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
223
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
224 Length@Empty Array[arr:out]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
225 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
226 out <- 0
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
227 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
228
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
229 Length@Array[arr:out]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
230 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
231 out <- [arr]Length >>
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
232 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
233
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
234 Length@Boxed Array[arr:out]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
235 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
236 out <- [arr]Length >>
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
237 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
238
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
239 Call@Array[arr,index(Int32):out,not found]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
240 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
241 out,not found <- [arr]Index[index]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
242 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
243
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
244 Call@Boxed Array[arr,index(Int32):out,not found]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
245 {
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
246 out,not found <- [arr]Index[index]
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
247 }
2f6f0867fd68 Added files I forgot to add in a previous commit
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
248