- Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvade_data.html
506 lines (487 loc) · 25 KB
/
vade_data.html
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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
<!DOCTYPE html>
<htmllang="en">
<head>
<metacharset="utf-8">
<metahttp-equiv="X-UA-Compatible" content="IE=edge">
<metaname="viewport" content="width=device-width, initial-scale=1">
<title>SmallBASIC | vade_data</title>
<metaname="description" content="SmallBASIC | One more basic">
<linkrel="canonical" href="/vade_data.html">
<linkrel="keywords" href="vade_data">
<linkrel="stylesheet" href="/css/style.css">
<linkrel="icon" type="image/png" href="/images/sb-desktop-32x32.png">
<scriptsrc="/clipboard.js"></script>
</head>
<body>
<buttononclick="topFunction()" id="BackToTopBtn" title="Go to top">⯅</button>
<scriptsrc="/backtotop.js"></script>
<divclass="wrapAll clearfix">
<navclass="navigation">
<divclass="logo">
<ahref="/"><imgsrc='/images/sb-logo.png?v=2' alt="logo"></a>
</div>
<divclass="navlinks">
<ahref="/pages/download.html">Download</a>
<ahref="/pages/news.html">News</a>
<ahref="/pages/community.html">Community</a>
<aclass='active' href="/pages/articles.html">Resources</a>
<ahref="/pages/reference.html">Language Reference</a>
<ahref="/pages/guide.html">SmallBASIC Manual</a>
</div>
</nav>
<divclass="mainsection">
<divclass="tabs clearfix">
<divclass="tabsRight">
<atarget="_github" href="https://github.com/smallbasic/smallbasic.github.io/blob/master/_build/pages/vade_data.markdown">Edit</a>
<atarget="_github" href="https://github.com/smallbasic/smallbasic.github.io/commits/master/_build/pages/vade_data.markdown">History</a>
</div>
</div>
<divclass="article">
<h1id="data">Data</h1>
<blockquote>
<p>Written by Elmar Vogt, Fürth, GERMANY</p>
</blockquote>
<divclass="siteSub">
<p><ahref="/">Home</a> > <ahref="/pages/vade.html">Vade</a></p>
</div>
<p>In this chapter, the Vademecum introduces you to the various ways
SmallBASIC handles program data – both simple variables and more complex
structures.</p>
<h2id="a-note-on-types">A Note on Types</h2>
<p>SmallBASIC is <strong>dynamically typed language</strong><a
href="#fn1" class="footnote-ref" id="fnref1"
role="doc-noteref"><sup>1</sup></a>. This means that one and the same
variable can hold numerical values and strings at different times.
Furthermore, necessary conversions are done automatically on the fly,
for example when a string is used as the parameter for a numerical
function:</p>
<pre><code>x= "3.141" ' string assignment
y= cos(x) ' no problem:
' x is automatically converted to a number
print y
> -1</code></pre>
<p>While there are also functions for explicit conversions, per default
conversions are done <sub>tacitly</sub> by the interpreter, without any
provisions in the SmallBASIC program, and there are also no
<sub>notifications</sub> when a type conversion occurs. Another
consequence is that the kind of data contained in a variable (or the
structure of a map) is only determined at runtime.<ahref="#fn2"
class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a> It
is up to the programmer to ensure that his code will
<sub>expect the unexpected</sub> and be able to cope with any data it is
fed with.</p>
<h2id="simple-variables">Simple Variables</h2>
<p>Simple variables <strong>need not be declared</strong>; they come
into existence by their first appearance in the source code. If they are
not created through an assignment, they will be initiated to the value
<sub>0</sub> (or, equivalently, to the empty string <sub>""</sub> (This
example admittedly looks a little silly).</p>
<p><strong>Value assignment</strong> is done with the <sub>=</sub>
operator: The value to the right of it (which may be another variable, a
literal, or a more complicated expression) is assigned to the variable
on the left:<ahref="#fn3" class="footnote-ref" id="fnref3"
role="doc-noteref"><sup>3</sup></a></p>
<pre><code>x= 20
y= 10
z= x+y
? z
>30
a= "Hello world"
? a
Hello world
"Goodbye world"= q</code></pre>
<p>The last line will cause an error, since the operands are in the
wrong order: It’s not possible to assign a variable like <sub>q</sub> to
a literal, only the other way around.</p>
<p>Historically, BASIC required the keyword <sub>let</sub> before an
assignment:</p>
<pre><code>let x=20</code></pre>
<p>SmallBASIC offers you the option to use this syntax variant for
compatibility reasons (read: nostalgia), but it’s deprecated.</p>
<h3id="numbers">Numbers</h3>
<p>Many languages have different types for various flavours of numbers –
signed or unsigned integers, reals, etc. – In contrast, SmallBASIC only
has a single class of numbers.<ahref="#fn4" class="footnote-ref"
id="fnref4" role="doc-noteref"><sup>4</sup></a></p>
<h3id="strings">Strings</h3>
<p>Strings are chains of one or several letters, used to represent
words, sentences or complete texts. A string consisting of zero letters
is called an <sub>empty</sub> string. (While I have a strong hunch that
strings are internally represented with UTF-8 unicode characters, it’s
probably safer to only assign ASCII letters to them.)</p>
<pre><code>my_name= "Elmar Vogt"
? "Hello, my name is ", my_name
> Hello, my name is Elmar Vogt</code></pre>
<p>Strings are dynamic objects in , meaning that they have no predefined
length: In the course of a program, they can change their length
arbitrarily, and there is no need to define a maximum length for them. A
theoretical upper length limit is set at 2 billion characters.<a
href="#fn5" class="footnote-ref" id="fnref5"
role="doc-noteref"><sup>5</sup></a></p>
<p><strong>String concatenation</strong> is done with the <code>+</code>
operator:</p>
<pre><code>my_name= "Elmar Vogt"
greeting= "Hello, my name is "
welcome= greeting + name
? welcome
> Hello, my name is Elmar Vogt</code></pre>
<p>The <code>+</code> operator combines the string operands to the left
and to the right of it to a new, third string, the length of which is
the sum of the individual strings’ lengths. If either the left or the
right operand is a number – a literal or a variable –, then this operand
will be converted to a string before the concatenation. For example, a
variable with the value <sub>42</sub> would be converted to a string of
two characters, namely <sub>4</sub> and <sub>2</sub>.<ahref="#fn6"
class="footnote-ref" id="fnref6" role="doc-noteref"><sup>6</sup></a></p>
<p>The <strong>length</strong> of a string is simply the number of
characters currently contained in the string:<ahref="#fn7"
class="footnote-ref" id="fnref7" role="doc-noteref"><sup>7</sup></a></p>
<pre><code>? len("Hello world")
> 11</code></pre>
<p><strong>String indexing</strong> is done with the first character of
a string being considered to be at position <code>1</code>:<a
href="#fn8" class="footnote-ref" id="fnref8"
role="doc-noteref"><sup>8</sup></a></p>
<pre><code>? mid("Help me", 4, 1)
> p</code></pre>
<p>This also means that the index of the <em>last</em> character of a
string is equivalent to its length:<ahref="#fn9" class="footnote-ref"
id="fnref9" role="doc-noteref"><sup>9</sup></a></p>
<pre><code>z= "Help me"
? mid(z, len(z), 1)
> e</code></pre>
<p>A loop designed to iterate over all characters in a string
<sub>x</sub> must thus look like this:</p>
<pre><code>for i=1 to len(x)
...
next i</code></pre>
<p>Note that this in contrast with the use of arrays (see below), where
the first array element has the index <code>0</code>, and for an array
with <code>n</code> elements the highest index is <code>n-1</code>.</p>
<h2id="complex-data-structures">Complex data structures</h2>
<p>Beside simple variables and literals, SmallBASIC also offers the
option of composing arbitrarily complex<ahref="#fn10"
class="footnote-ref" id="fnref10" role="doc-noteref"><sup>10</sup></a>
variable structures. These come in two flavours:</p>
<p>Simple arrays (), and maps ().</p>
<p>From ’s point of view, both are the same. Technically, arrays are
simply a subset of possible maps, but to make it easier to grasp the
concept, we’ll treat both as different entities for the moment.</p>
<p>In contrast to simple variables, complex data structures <strong>must
be declared before use</strong> with the <sub>dim</sub> statement.</p>
<pre><code>dim x</code></pre>
<p>Since (almost) all variables are handled dynamically in SmallBASIC
and can change their structure during their lifetime, it is neither
necessary nor useful to define details or the size of the data structure
at hand.</p>
<h3id="arrays-array">Arrays <spanid="array"
label="array">[array]</span></h3>
<p>Arrays are the more simple way of agglomerating data into a single
variable. SmallBASIC treats them much like the way other programming
languages do. An array holds a number of variables which are accessed by
means of the array name, and a numerical index, pretty much like a
street address is a combination of the street’s name, and a house
number. To access an array member, its name is followed by the index in
parentheses <sub>()</sub>:</p>
<pre><code>hoogla(i)= boogla(250)</code></pre>
<p>will assign the value of <sub>boogla</sub>’s 250th member to the
member of <sub>hoogla</sub> with the numerical index <sub>i</sub>.</p>
<p>Array members can be of <strong>mixed content</strong>, ie it’s
perfectly okay for one member of an array to hold a number, and for a
different member of the same array to hold a string.</p>
<p>Arrays must be <strong>defined before use</strong>, and while they
are dynamic and can change their size on the fly, room for an array
member must be defined before it can be used, by using the
<sub>dim</sub> statement along with a numerical value:</p>
<pre><code>dim hoogla(250)</code></pre>
<p>will define <sub>hoogla</sub> to initially have <sub>251</sub>
members with indices <sub>0..250</sub>. This <strong>array
indexing</strong> contrasts with the indexing of strings.</p>
<p>Array members can be erased from the array with <sub>delete</sub>.
Note that if the <code>i</code>th member of an array is deleted, then
all array members with higher indices <sub>move down</sub> one notch, ie
the value of <sub>x(n)</sub> will now be in <sub>x(n-1)</sub>.</p>
<p>Likewise, new array members can be appended to an array with the
operator <sub><<</sub>.<ahref="#fn11" class="footnote-ref"
id="fnref11" role="doc-noteref"><sup>11</sup></a></p>
<pre><code>dim hoogla(250)
hoogla << 132</code></pre>
<p>means that now <sub>hoogla</sub> will have <sub>252</sub> members,
and the new <sub>252</sub>nd member (with the index <sub>251</sub>) will
have the value <sub>132</sub>.</p>
<p>Arrays are not limited to being a chain of values. <strong>Several
array dimensions</strong> can be defined to render arrays of
<sub>rectangular</sub>, <sub>cubic</sub>, <sub>tesseractic</sub> or even
higher dimensions:</p>
<pre><code>dim hoogla(10, 20, 10)
hoogla(5, 9, 8)= "blubbdi"</code></pre>
<p>will create an array with <code>11 X 21 X 11</code> members, or
access one particular member, resp. For obvious reasons, it’s not
possible to <sub>delete</sub> members of such a higher-dimensional array
in the above mentioned way. Likewise, using the appendix
<sub><<</sub> operator with a higher-dimensional array should be
avoided.<ahref="#fn12" class="footnote-ref" id="fnref12"
role="doc-noteref"><sup>12</sup></a></p>
<p>The maximum array size is virtually unlimited. But note that with the
introduction of new array dimensions, the space and performance
requirements increase exponentially.</p>
<h3id="maps">Maps</h3>
<p>Maps differ from arrays in two ways: Firstly, while arrays always
have a linear or <sub>rectangular</sub> structure, <strong>maps are
<sub>data trees</sub>, where each map member can be a simple variable,
an array or a complete map</strong>. This structure can become extremely
complex during the runtime of a program. As explained in , since there
is no fixed type system, and hence no predetermined structure for any
given map, this means that an SmallBASIC program must
<sub>anticipate all known unknowns</sub>.</p>
<p>Secondly, map indices aren’t limited to a consecutive list of integer
numbers. Rather, <strong>map members can be accessed by any simple
variable – string, integer or real</strong>. This leads to subtle syntax
differences when accessing them and has a number of other consequences.
For example, it’s not straightforward anymore to write a loop which will
iterate over all map members, or determine the number of map elements.
The concept is probably more easy to grasp when one doesn’t think of
maps as of traditional arrays, but to consider each member a pair of a
<sub>value</sub>, which is stored in the map, and a <sub>key</sub> (the
index) by which it is accessed.</p>
<p>These two features in combination with ’s automatic conversion
features lead to the fact that <strong>it is fairly easy to
inadvertently convert an array into a map</strong>, a conversion from
which there is no easy way back, and thus to create havoc at
runtime.</p>
<p><strong>Map initialisation</strong> can be done by in three ways:
Either explicitly, by using the <sub>dim</sub> keyword <em>without</em>
an array size (ie, simply <sub>dim x</sub> is enough), through the
<sub>array</sub> keyword (see below), or implicitly by assigning the map
members values by a sequence of comma-separated values, enclosed in
square brackets <sub>[]</sub>:</p>
<pre><code>hoogla= [10, 9, 8, 7, 6, 1]</code></pre>
<p>initialises a simple map <sub>hoogla</sub> with <sub>6</sub> members
with automatically generated indices from <sub>0</sub> to
<sub>5</sub>.</p>
<p>To create more complex structures, each map member which is a map
again must be enclosed in brackets. For example,</p>
<pre><code>boogla= [1, 2, [4, 5, 6, 7], 2390023, [3.1415926, "hoogla!"], 99]</code></pre>
<p>can be visualized in a structure like this:</p>
<pre><code>1
2
4 5 6 7
3.1415926 "hoogla!"
99</code></pre>
<p>To initialise a map in that way, it does <em>not</em> need to be
defined with <sub>dim</sub> beforehand – actually, a square bracket
initialisation will delete any variable with the same name that may have
been existing before, and create a completely new one.</p>
<p>Furthermore, the <sub>array</sub> keyword can be used as an
alternative way to initialize a map (though not an array, confusingly).
Basically, what you do is that you pass your map members in the shape of
a JSON-formatted string<ahref="#fn13" class="footnote-ref" id="fnref13"
role="doc-noteref"><sup>13</sup></a> to the <sub>array</sub>
function:</p>
<pre><code>boogla= array("[1, 2, [4, 5, 6, 7], [3.1415926, \"hoogla!\"], 99]")</code></pre>
<p>is equivalent to the map definition above. Be aware that you pass
<em>all</em> map members to <sub>array</sub> wrapped in a single string,
rather than as individual elements. Likewise, if you use string
variables in your map, these must be escaped with backslashes inside the
<sub>array</sub> argument (ie, <sub>\"hoogla\"</sub> rather than simply
<sub>"hoogla"</sub>.</p>
<p>A further neat feature is that maps of any complexity can be
serialized with a simple <sub>print</sub> command to a file.
<sub>Print</sub> will not only display a single member, but will format
the output as a JSON string. This means – without going into too many
details regarding file handling here – that writing a complete map to a
file and loading it again at a later stage are simple three-liner
tasks.</p>
<p><strong>Access to map members</strong> is possible through two
different notations. The first one contains the key to the map member in
parentheses after the map name:</p>
<pre><code>boogla(3.1415926)= ...</code></pre>
<p>which is similar to an array access, with the exception that the key
may be a real value, or even a string:</p>
<pre><code>boogla("nuffda")= ...</code></pre>
<p>The second option uses the <sub>dot notation</sub> familiar from
other languages like <sub>C</sub>, seperating the name from the member
key with a dot <sub>.</sub>:</p>
<pre><code>boogla.nuffda= ...</code></pre>
<p>The two notations are for the most part equivalent, while the second
alternative makes sure that you’re accessing a map, not an array.</p>
<p>For more complex maps with nested structures, you simply
<sub>chain</sub> your notations to access the lower-level members:</p>
<pre><code>boogla.nuffda.oingaboinga= ...</code></pre>
<p>The notations can be mixed within a single variable access:</p>
<pre><code>dim boogla
z.tschaka= "Hello, world!"
boogla("gloegk")= z
? boogla.gloegk("tschaka")
> Hello, world!</code></pre>
<p>But this is not recommended, because it is too easy to inadvertently
mess up your dots and parentheses and accessing a non-existent map
member.<ahref="#fn14" class="footnote-ref" id="fnref14"
role="doc-noteref"><sup>14</sup></a></p>
<p>An interesting feature is that with the parentheses notation, a
variable may be used as key, which isn’t possible with dot notation:</p>
<pre><code>z.tschaka= "Hello, world!"
target= "tschaka"
? z(target), z.target
> Hello, world! 0</code></pre>
<p>When accessing <sub>z</sub> in the third line, in the first term
<sub>z(target)</sub>, <sub>target</sub> is replaced with its value
<sub>tschaka</sub> by the interpreter, before looking the map member
with that name up and returning the result, <sub>"Hello, world!"</sub>.
In the second term <sub>z.target</sub>, the interpreter looks for a
member of <sub>z</sub> with the key <sub>target</sub>, can’t find one,
and tacitly creates a new one which is initialized with the value
<sub>0</sub>.<ahref="#fn15" class="footnote-ref" id="fnref15"
role="doc-noteref"><sup>15</sup></a></p>
<p>This makes the parentheses notation particularly useful when you want
to decide at runtime which map member you want to access: With dot
notation, access is fixed, but with parentheses notation you can pass a
variable to determine which member to use in that instance.</p>
<p>For both arrays and maps, <code>len(x)</code> will give you the
number of elements in the structure. But note that this isn’t the total
number of elements, but only the number of elements in the
<sub>top dimension</sub>.</p>
<p>For example, when initializing an array as</p>
<pre><code>boogla= [1, 2, [4, 5, 6, 7], 2390023, [3.1415926, "hoogla!"], 99]
'boogla will be 6, as this is the number of first-dimension
'members, not 10, which would be the total number of elements.
'Almost, but Not Quite the Same (Not a Rose by any other Name
'The near-but-not-quite equivalency of maps and arrays leads to
'interesting consequences, read: causes for unexpected trouble. For
'example, in the following code
dim x
dim z
x("hello")= 10
x(5)= 55
z(5)= 10
z("hello")= 55</code></pre>
<p>the third and fourth line cause no errors, but the fifth one does.
Why is this? The cause is, that after the <sub>dim</sub> command,
<sub>x</sub> and <sub>z</sub> essentially are still shapeless
somethings, but the first access with a string for an index forces
<sub>x</sub> to become a map (line 3). Accessing it <em>afterwards</em>
with a numerical key is no problem at all. <sub>z</sub> on the other
hand is firstly accessed as an array (line 5), and this leads to
problems, because neither has its size been defined, nor has the
appendix operator been used.</p>
<p>Likewise,</p>
<pre><code>dim x
z= "hello"
x(z)= 3.14
x << 99</code></pre>
<p>throws an error in the last line, namely
<sub>index out of range</sub>. The first use of <sub>x</sub> forced it
to become a map, but unfortunately, the appendix operator is only
defined for arrays,<ahref="#fn16" class="footnote-ref" id="fnref16"
role="doc-noteref"><sup>16</sup></a> hence the error.</p>
<p>Finally,</p>
<pre><code>zoogla= [[1, 2, 3], [10, 11, 12], [99, 98, 97]]</code></pre>
<p>looks tantalizingly like a definition for a two-dimensional array,
but it actually is a map – which you find out when you try to access it
like an array; <sub>zoogla(2, 2)</sub> will cause an
<sub>out of range</sub> error. Only <sub>zoogla(2)(2)</sub> will
work.</p>
<p>In a nutshell: Try to avoid arrays whenever possible. In the long
run, you’re better off if you force your structures to be maps and treat
them accordingly.</p>
<h2id="references">References</h2>
<h3id="referencing-routines">Referencing Routines</h3>
<p>The reference operator works on routines:</p>
<pre><code>boogla= @honk
zoogla= @buzz
call boogla, 1, 2, 3
call @honk, 4, 5, 6
? call(zoogla, 5)
sub honk(x, y, z)
print x*y*z
end
func buzz(x)
buzz= x*x
end
> 6
> 120
> 25</code></pre>
<p>The keyword is used to invoke a routine. It is followed by the
reference to the routine, or a variable which holds the reference,<a
href="#fn17" class="footnote-ref" id="fnref17"
role="doc-noteref"><sup>17</sup></a>, and a comma-separated list of
parameters. Note that if a procedure is <sub>call</sub>ed, the parameter
list <em>must not</em> be in parentheses, while when you <sub>call</sub>
a function, it <em>must</em>.</p>
<sectionid="footnotes" class="footnotes footnotes-end-of-document"
role="doc-endnotes">
<hr/>
<ol>
<liid="fn1"><p>sometimes also referred to somehow incorrectly as a
<sub>typeless</sub> language<ahref="#fnref1" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<liid="fn2"><p>Contrast this behaviour to other languages like
<sub>C</sub>, where a strict type discipline is enforced.<a
href="#fnref2" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<liid="fn3"><p>The command <sub>?</sub> used below is a shorthand for
<sub>print</sub>: It will display the current values of all the
following literals or variables on the screen.<ahref="#fnref3"
class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<liid="fn4"><p>While SmallBASIC internally also represents numbers
either as integers or, if they carry fractions or exceed the limits for
integers, as 64 bit reals, this is invisible to the user, since all
conversions are done implicitly and automatically when required.<a
href="#fnref4" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<liid="fn5"><p>Even before that SmallBASIC tends to get too tediously
slow for all practical purposes.<ahref="#fnref5" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<liid="fn6"><p>Obviously, if <em>both</em> operands are numbers,
<code>+</code> will perform a simple addition and assign the sum of both
values to the variable on the left of the equality sign.<a
href="#fnref6" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<liid="fn7"><p>The function <sub>len()</sub> returns the length of the
following argument in brackets<ahref="#fnref7" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<liid="fn8"><p>The function <sub>mid(x, y, z)</sub> returns
<sub>z</sub> characters from the string <sub>x</sub>, beginning with the
<sub>y</sub>th<ahref="#fnref8" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<liid="fn9"><p>The function <sub>len()</sub> returns the length of its
string argument, in number of characters<ahref="#fnref9"
class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<liid="fn10"><p><sub>Complex</sub> here denoting intricate constructs,
not the mathematical notion of complex numbers<ahref="#fnref10"
class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<liid="fn11"><p>Sorry for the ugly typography here.<ahref="#fnref11"
class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<liid="fn12"><p>While technically it works, it will actually transform
the array into a <em>one-dimensional</em> array, arrange the previous
values sequentially and finally append the new array member. But this is
dark voodoo and should not be practiced. Besides, there is no guarantee
that this behaviour will be retained in future versions of .<a
href="#fnref12" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<liid="fn13"><p><sub>JavaScript Object Notation</sub>, see eg <a
href="http://en.wikipedia.org/wiki/JSON">Wikipedia</a> for details<a
href="#fnref13" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<liid="fn14"><p>Since it isn’t necessary to declare map members before
accessing them, you will not get a warning in such a case and may spend
many hours debugging.<ahref="#fnref14" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<liid="fn15"><p>Wrap your heads around this, folks. It’s important.<a
href="#fnref15" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<liid="fn16"><p>and it <em>can</em> only be defined for arrays, because
what would be the key for the value appended, if the recipient was a
map?<ahref="#fnref16" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<liid="fn17"><p>If you think about it, only the latter case is really
really useful.<ahref="#fnref17" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
</ol>
</section>
</div>
<divclass="pagefooter">
This page was last edited on Tue, 27 Mar 2018 21:57:51 +1000
|
<ahref="https://en.wikipedia.org/wiki/Markdown" target="_blank" rel="nofollow">Markdown</a>
processed with
<ahref="https://pandoc.org/MANUAL.html#pandocs-markdown" target="_blank" rel="nofollow">pandoc 3.1.12.1</a>
</div>
</div>
</div>
</body>
</html>