@@ -39,9 +39,9 @@ data it is fed with.
3939Simple Variables
4040---------------- 
4141
42- Simple variables ** need not be declared** ; they come into existance  by
42+ Simple variables ** need not be declared** ; they come into existence  by
4343their first appearance in the source code. If they are not created
44- through an assignment, they will be initiated to the value » ; $0$ « ; 
44+ through an assignment, they will be initiated to the value » ; ` 0 ` « ; 
4545(or, equivalently, to the empty string » ; \"\" « ; . (This example
4646admittedly looks a little silly.)
4747
@@ -80,16 +80,12 @@ Many languages have different types for various flavours of numbers --
8080signed or unsigned integers, reals, etc. -- In contrast, SmallBASIC only has a
8181single class of numbers.[ ^ 4 ] 
8282
83- SmallBASIC numbers can have absolute values roughly between $2.2\cdot
84- 10^{-208}$ (smaller values are considered $0$) and $1.8\cdot 10^{308}$
85- (larger values raise a flag (for » ; infinity« ; ).
86- 
8783### Strings  
8884
8985Strings are chains of one or several letters, used to represent words,
9086sentences or complete texts. A string consisting of zero letters is
9187called an » ; empty« ;  string. (While I have a strong hunch that
92- strings are internally represented with UTF-8 unicode  characters, it's
88+ strings are internally represented with UTF-8 Unicode  characters, it's
9389probably safer to only assign ASCII letters to them.)
9490
9591    my_name= "Elmar Vogt" 
@@ -102,7 +98,7 @@ length: In the course of a program, they can change their length
10298arbitrarily, and there is no need to define a maximum length for them. A
10399theoretical upper length limit is set at 2 billion characters.[ ^ 5 ] 
104100
105- ** String concatenation**  is done with the $+$  operator:
101+ ** String concatenation**  is done with the ` + `  operator:
106102
107103    my_name= "Elmar Vogt" 
108104    greeting= "Hello, my name is " 
@@ -111,7 +107,7 @@ theoretical upper length limit is set at 2 billion characters.[^5]
111107
112108    > Hello, my name is Elmar Vogt 
113109
114- The $+$  operator combines the string operands to the left and to the
110+ The ` + `  operator combines the string operands to the left and to the
115111right of it to a new, third string, the length of which is the sum of
116112the individual strings' lengths. If either the left or the right operand
117113is a number -- a literal or a variable --, then this operand will be
@@ -127,7 +123,7 @@ contained in the string:[^7]
127123    > 11 
128124
129125** String indexing**  is done with the first character of a string being
130- considere  to be at position $1$ :[ ^ 8 ] 
126+ considered  to be at position ` 1 ` :[ ^ 8 ] 
131127
132128    ? mid("Help me", 4, 1) 
133129
@@ -149,8 +145,8 @@ look like this:
149145    next i 
150146
151147Note that this in contrast with the use of arrays (see below), where the
152- first array element has the index $0$ , and for an array with $n$ 
153- elements the highest index is $ n-1$ .
148+ first array element has the index ` 0 ` , and for an array with ` n ` 
149+ elements the highest index is ` n-1 ` .
154150
155151Complex data structures
156152----------------------- 
@@ -186,7 +182,7 @@ array member, its name is followed by the index in parentheses :
186182    hoogla(i)= boogla(250) 
187183
188184will assign the value of 's 250th member to the member of with the
189- numberical  index .
185+ numerical  index .
190186
191187Array members can be of ** mixed content** , ie it's perfectly okay for
192188one member of an array to hold a number, and for a different member of
@@ -199,10 +195,10 @@ numerical value:
199195
200196    dim hoogla(250) 
201197
202- will define to initially have $ 251$  members with indices $ 0..250$ . This
198+ will define to initially have ` 251 `  members with indices ` 0..250 ` . This
203199** array indexing**  contrasts with the indexing of strings.
204200
205- Array members can be erased from the array with . Note that if the $i$ th
201+ Array members can be erased from the array with . Note that if the ` i ` th
206202member of an array is deleted, then all array members with higher
207203indices » ; move down« ;  one notch, ie the value of will now be in .
208204
@@ -212,8 +208,8 @@ operator .[^11]
212208    dim hoogla(250) 
213209    hoogla << 132 
214210
215- means that now will have $ 252$  members, and the new $ 252$ nd member (with
216- the index $ 251$ ) will have the value $ 132$ .
211+ means that now will have ` 252 `  members, and the new ` 252 ` nd member (with
212+ the index ` 251 ` ) will have the value ` 132 ` .
217213
218214Arrays are not limited to being a chain of values. ** Several array
219215dimensions**  can be defined to render arrays of » ; rectangular« ; ,
@@ -222,17 +218,17 @@ dimensions** can be defined to render arrays of »rectangular«,
222218    dim hoogla(10, 20, 10) 
223219    hoogla(5, 9, 8)= "blubbdi" 
224220
225- will create an array with $ 11 \times 21 \times 11$  members, or access
221+ will create an array with ` 11 \times 21 \times 11 `  members, or access
226222one particular member, resp. For obvious reasons, it's not possible to
227- members of such a higher-dimensional array in the abovementioned  way.
223+ members of such a higher-dimensional array in the above mentioned  way.
228224Likewise, using the appendix operator with a higher-dimensional array
229225should be avoided.[ ^ 12 ] 
230226
231227The maximum array size is virtually unlimited. But note that with the
232228introduction of new array dimensions, the space and performance
233229requirements increase exponentially.
234230
235- ### Maps  [ \[ map \] ] {#map label="map"}   
231+ ### Maps  
236232
237233Maps differ from arrays in two ways: Firstly, while arrays always have a
238234linear or » ; rectangular« ;  structure, ** maps are » ; data trees« ; ,
@@ -261,13 +257,13 @@ and thus to create havoc at runtime.
261257** Map initialisation**  can be done by in three ways: Either explicitly,
262258by using the keyword * without*  an array size (ie, simply is enough),
263259through the keyword (see below), or implicitly by assigning the map
264- members values by a sequence of comma-seperated  values, enclosed in
260+ members values by a sequence of comma-separated  values, enclosed in
265261square brackets :
266262
267263    hoogla= [10, 9, 8, 7, 6, 1] 
268264
269- initialises a simple map with $6$  members with automatically generated
270- indices from $0$  to $5$ .
265+ initialises a simple map with ` 6 `  members with automatically generated
266+ indices from ` 0 `  to ` 5 ` .
271267
272268To create more complex structures, each map member which is a map again
273269must be enclosed in brackets. For example,
@@ -319,7 +315,7 @@ be a real value, or even a string:
319315    boogla("nuffda")= ... 
320316
321317The second option uses the » ; dot notation« ;  familiar from other
322- languages like » ; C« ; , seperating  the name from the member key with a
318+ languages like » ; C« ; , separating  the name from the member key with a
323319dot :
324320
325321    boogla.nuffda= ... 
@@ -358,35 +354,30 @@ When accessing in the third line, in the first term , is replaced with
358354its value by the interpreter, before looking the map member with that
359355name up and returning the result, . In the second term , the interpreter
360356looks for a member of with the key , can't find one, and tacitly creates
361- a new one which is initialized with the value $0$ .[ ^ 15 ] 
357+ a new one which is initialized with the value ` 0 ` .[ ^ 15 ] 
362358
363359This makes the parentheses notation particularly useful when you want to
364360decide at runtime which map member you want to access: With dot
365361notation, access is fixed, but with parentheses notation you can pass a
366362variable to determine which member to use in that instance.
367363
368- ###  [ \[ cLen\] ] {#cLen label="cLen"} 
369- 
370364For both arrays and maps, will give you the number of elements in the
371365structure. But note that this isn't the total number of elements, but
372366only the number of elements in the » ; top dimension« ; .
373367
374368For example, when initializing an array as
375369
376370    boogla= [1, 2, [4, 5, 6, 7], 2390023, [3.1415926, "hoogla!"], 99] 
377-     \end 
378371
379-     \Co{len( boogla)}  will be $6$ , as this is the number of first-dimension
380-     members, not 10, which would be the total number of elements. 
372+     ' boogla will be 6 , as this is the number of first-dimension
373+     ' members, not 10, which would be the total number of elements.
381374
382-     \subsection{Almost, but Not Quite the Same (Not a Rose by any other 
383-     Name)} 
375+     'Almost, but Not Quite the Same (Not a Rose by any other Name 
384376
385-     The \textbf{ near-but-not-quite equivalency of maps and arrays}  leads to 
386-     interesting consequences, read: causes for unexpected trouble. For 
387-     example, in the following code 
377+     ' The near-but-not-quite equivalency of maps and arrays leads to
378+     ' interesting consequences, read: causes for unexpected trouble. For
379+     ' example, in the following code
388380
389-     \begin{lstlisting} 
390381    dim x 
391382    dim z 
392383    x("hello")= 10 
@@ -462,7 +453,7 @@ Continue the above code:
462453
463454    > 20        50 
464455
465- What gives? When executing , the value $50$  is assigned to the variable
456+ What gives? When executing , the value ` 50 `  is assigned to the variable
466457, which from this point on no longer holds 's address; the link between
467458the two variables is broken, and the variables go their seperate ways.
468459So, as long as is a reference to , it will always reflect the current
@@ -537,15 +528,15 @@ it *must*.
537528[ ^ 5 ] : Even before that SmallBASIC tends to get too tediously slow for all
538529    practical purposes.
539530
540- [ ^ 6 ] : Obviously, if * both*  operands are numbers, $+$  will perform a
531+ [ ^ 6 ] : Obviously, if * both*  operands are numbers, ` + `  will perform a
541532    simple addition and assign the sum of both values to the variable on
542533    the left of the equality sign.
543534
544535[ ^ 7 ] : The function returns the length of the following argument in
545536    brackets
546537
547- [ ^ 8 ] : The function returns $z$  characters from the string $x$ , beginning
548-     with the $y$ th
538+ [ ^ 8 ] : The function returns ` z `  characters from the string ` x ` , beginning
539+     with the ` y ` th
549540
550541[ ^ 9 ] : The function returns the length of its string argument, in number
551542    of characters
0 commit comments