1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
\begin{patch}{FlexibleArrayXmpPagePatch1}
\begin{paste}{FlexibleArrayXmpPageFull1}{FlexibleArrayXmpPageEmpty1}
\pastebutton{FlexibleArrayXmpPageFull1}{\hidepaste}
\tab{5}\spadcommand{flexibleArray [i for i in 1..6]}
\indentrel{3}\begin{verbatim}
(1) [1,2,3,4,5,6]
Type: FlexibleArray PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty1}
\begin{paste}{FlexibleArrayXmpPageEmpty1}{FlexibleArrayXmpPagePatch1}
\pastebutton{FlexibleArrayXmpPageEmpty1}{\showpaste}
\tab{5}\spadcommand{flexibleArray [i for i in 1..6]}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch2}
\begin{paste}{FlexibleArrayXmpPageFull2}{FlexibleArrayXmpPageEmpty2}
\pastebutton{FlexibleArrayXmpPageFull2}{\hidepaste}
\tab{5}\spadcommand{f : FARRAY INT := new(6,0)\bound{f }}
\indentrel{3}\begin{verbatim}
(2) [0,0,0,0,0,0]
Type: FlexibleArray Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty2}
\begin{paste}{FlexibleArrayXmpPageEmpty2}{FlexibleArrayXmpPagePatch2}
\pastebutton{FlexibleArrayXmpPageEmpty2}{\showpaste}
\tab{5}\spadcommand{f : FARRAY INT := new(6,0)\bound{f }}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch3}
\begin{paste}{FlexibleArrayXmpPageFull3}{FlexibleArrayXmpPageEmpty3}
\pastebutton{FlexibleArrayXmpPageFull3}{\hidepaste}
\tab{5}\spadcommand{for i in 1..6 repeat f.i := i; f\bound{f1 }\free{f }}
\indentrel{3}\begin{verbatim}
(3) [1,2,3,4,5,6]
Type: FlexibleArray Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty3}
\begin{paste}{FlexibleArrayXmpPageEmpty3}{FlexibleArrayXmpPagePatch3}
\pastebutton{FlexibleArrayXmpPageEmpty3}{\showpaste}
\tab{5}\spadcommand{for i in 1..6 repeat f.i := i; f\bound{f1 }\free{f }}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch4}
\begin{paste}{FlexibleArrayXmpPageFull4}{FlexibleArrayXmpPageEmpty4}
\pastebutton{FlexibleArrayXmpPageFull4}{\hidepaste}
\tab{5}\spadcommand{physicalLength f\free{f1 }}
\indentrel{3}\begin{verbatim}
(4) 6
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty4}
\begin{paste}{FlexibleArrayXmpPageEmpty4}{FlexibleArrayXmpPagePatch4}
\pastebutton{FlexibleArrayXmpPageEmpty4}{\showpaste}
\tab{5}\spadcommand{physicalLength f\free{f1 }}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch5}
\begin{paste}{FlexibleArrayXmpPageFull5}{FlexibleArrayXmpPageEmpty5}
\pastebutton{FlexibleArrayXmpPageFull5}{\hidepaste}
\tab{5}\spadcommand{concat!(f,11)\bound{f2 }\free{f1 }}
\indentrel{3}\begin{verbatim}
(5) [1,2,3,4,5,6,11]
Type: FlexibleArray Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty5}
\begin{paste}{FlexibleArrayXmpPageEmpty5}{FlexibleArrayXmpPagePatch5}
\pastebutton{FlexibleArrayXmpPageEmpty5}{\showpaste}
\tab{5}\spadcommand{concat!(f,11)\bound{f2 }\free{f1 }}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch6}
\begin{paste}{FlexibleArrayXmpPageFull6}{FlexibleArrayXmpPageEmpty6}
\pastebutton{FlexibleArrayXmpPageFull6}{\hidepaste}
\tab{5}\spadcommand{physicalLength f\free{f2 }}
\indentrel{3}\begin{verbatim}
(6) 10
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty6}
\begin{paste}{FlexibleArrayXmpPageEmpty6}{FlexibleArrayXmpPagePatch6}
\pastebutton{FlexibleArrayXmpPageEmpty6}{\showpaste}
\tab{5}\spadcommand{physicalLength f\free{f2 }}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch7}
\begin{paste}{FlexibleArrayXmpPageFull7}{FlexibleArrayXmpPageEmpty7}
\pastebutton{FlexibleArrayXmpPageFull7}{\hidepaste}
\tab{5}\spadcommand{physicalLength!(f,15)\bound{f3 }\free{f2 }}
\indentrel{3}\begin{verbatim}
(7) [1,2,3,4,5,6,11]
Type: FlexibleArray Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty7}
\begin{paste}{FlexibleArrayXmpPageEmpty7}{FlexibleArrayXmpPagePatch7}
\pastebutton{FlexibleArrayXmpPageEmpty7}{\showpaste}
\tab{5}\spadcommand{physicalLength!(f,15)\bound{f3 }\free{f2 }}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch8}
\begin{paste}{FlexibleArrayXmpPageFull8}{FlexibleArrayXmpPageEmpty8}
\pastebutton{FlexibleArrayXmpPageFull8}{\hidepaste}
\tab{5}\spadcommand{concat!(f,f)\bound{f4 }\free{f3 }}
\indentrel{3}\begin{verbatim}
(8) [1,2,3,4,5,6,11,1,2,3,4,5,6,11]
Type: FlexibleArray Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty8}
\begin{paste}{FlexibleArrayXmpPageEmpty8}{FlexibleArrayXmpPagePatch8}
\pastebutton{FlexibleArrayXmpPageEmpty8}{\showpaste}
\tab{5}\spadcommand{concat!(f,f)\bound{f4 }\free{f3 }}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch9}
\begin{paste}{FlexibleArrayXmpPageFull9}{FlexibleArrayXmpPageEmpty9}
\pastebutton{FlexibleArrayXmpPageFull9}{\hidepaste}
\tab{5}\spadcommand{insert!(22,f,1)\bound{f5 }\free{f4 }}
\indentrel{3}\begin{verbatim}
(9) [22,1,2,3,4,5,6,11,1,2,3,4,5,6,11]
Type: FlexibleArray Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty9}
\begin{paste}{FlexibleArrayXmpPageEmpty9}{FlexibleArrayXmpPagePatch9}
\pastebutton{FlexibleArrayXmpPageEmpty9}{\showpaste}
\tab{5}\spadcommand{insert!(22,f,1)\bound{f5 }\free{f4 }}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch10}
\begin{paste}{FlexibleArrayXmpPageFull10}{FlexibleArrayXmpPageEmpty10}
\pastebutton{FlexibleArrayXmpPageFull10}{\hidepaste}
\tab{5}\spadcommand{g := f(10..)\bound{g }\free{f5 }}
\indentrel{3}\begin{verbatim}
(10) [2,3,4,5,6,11]
Type: FlexibleArray Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty10}
\begin{paste}{FlexibleArrayXmpPageEmpty10}{FlexibleArrayXmpPagePatch10}
\pastebutton{FlexibleArrayXmpPageEmpty10}{\showpaste}
\tab{5}\spadcommand{g := f(10..)\bound{g }\free{f5 }}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch11}
\begin{paste}{FlexibleArrayXmpPageFull11}{FlexibleArrayXmpPageEmpty11}
\pastebutton{FlexibleArrayXmpPageFull11}{\hidepaste}
\tab{5}\spadcommand{insert!(g,f,1)\bound{g1 }\free{g f5 }}
\indentrel{3}\begin{verbatim}
(11) [2,3,4,5,6,11,22,1,2,3,4,5,6,11,1,2,3,4,5,6,11]
Type: FlexibleArray Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty11}
\begin{paste}{FlexibleArrayXmpPageEmpty11}{FlexibleArrayXmpPagePatch11}
\pastebutton{FlexibleArrayXmpPageEmpty11}{\showpaste}
\tab{5}\spadcommand{insert!(g,f,1)\bound{g1 }\free{g f5 }}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch12}
\begin{paste}{FlexibleArrayXmpPageFull12}{FlexibleArrayXmpPageEmpty12}
\pastebutton{FlexibleArrayXmpPageFull12}{\hidepaste}
\tab{5}\spadcommand{merge!(sort! f, sort! g)\bound{f6 }\free{g f5 }}
\indentrel{3}\begin{verbatim}
(12)
[1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5,
6, 6, 6, 6, 11, 11, 11, 11, 22]
Type: FlexibleArray Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty12}
\begin{paste}{FlexibleArrayXmpPageEmpty12}{FlexibleArrayXmpPagePatch12}
\pastebutton{FlexibleArrayXmpPageEmpty12}{\showpaste}
\tab{5}\spadcommand{merge!(sort! f, sort! g)\bound{f6 }\free{g f5 }}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch13}
\begin{paste}{FlexibleArrayXmpPageFull13}{FlexibleArrayXmpPageEmpty13}
\pastebutton{FlexibleArrayXmpPageFull13}{\hidepaste}
\tab{5}\spadcommand{removeDuplicates! f\bound{f7 }\free{f6 }}
\indentrel{3}\begin{verbatim}
(13) [1,2,3,4,5,6,11,22]
Type: FlexibleArray Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty13}
\begin{paste}{FlexibleArrayXmpPageEmpty13}{FlexibleArrayXmpPagePatch13}
\pastebutton{FlexibleArrayXmpPageEmpty13}{\showpaste}
\tab{5}\spadcommand{removeDuplicates! f\bound{f7 }\free{f6 }}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch14}
\begin{paste}{FlexibleArrayXmpPageFull14}{FlexibleArrayXmpPageEmpty14}
\pastebutton{FlexibleArrayXmpPageFull14}{\hidepaste}
\tab{5}\spadcommand{select!(i +-> even? i,f)\bound{f8 }\free{f7 }}
\indentrel{3}\begin{verbatim}
(14) [2,4,6,22]
Type: FlexibleArray Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty14}
\begin{paste}{FlexibleArrayXmpPageEmpty14}{FlexibleArrayXmpPagePatch14}
\pastebutton{FlexibleArrayXmpPageEmpty14}{\showpaste}
\tab{5}\spadcommand{select!(i +-> even? i,f)\bound{f8 }\free{f7 }}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch15}
\begin{paste}{FlexibleArrayXmpPageFull15}{FlexibleArrayXmpPageEmpty15}
\pastebutton{FlexibleArrayXmpPageFull15}{\hidepaste}
\tab{5}\spadcommand{physicalLength f\free{b8 }}
\indentrel{3}\begin{verbatim}
(15) 8
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty15}
\begin{paste}{FlexibleArrayXmpPageEmpty15}{FlexibleArrayXmpPagePatch15}
\pastebutton{FlexibleArrayXmpPageEmpty15}{\showpaste}
\tab{5}\spadcommand{physicalLength f\free{b8 }}
\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPagePatch16}
\begin{paste}{FlexibleArrayXmpPageFull16}{FlexibleArrayXmpPageEmpty16}
\pastebutton{FlexibleArrayXmpPageFull16}{\hidepaste}
\tab{5}\spadcommand{shrinkable(false)$FlexibleArray(Integer)}
\indentrel{3}\begin{verbatim}
(16) true
Type: Boolean
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{FlexibleArrayXmpPageEmpty16}
\begin{paste}{FlexibleArrayXmpPageEmpty16}{FlexibleArrayXmpPagePatch16}
\pastebutton{FlexibleArrayXmpPageEmpty16}{\showpaste}
\tab{5}\spadcommand{shrinkable(false)$FlexibleArray(Integer)}
\end{paste}\end{patch}
|