Skip to content

Commit 7e5d897

Browse files
committed
VADE: cleanup conversion from latex
1 parent fdd33cb commit 7e5d897

File tree

11 files changed

+118
-155
lines changed

11 files changed

+118
-155
lines changed

_build/pages/vade.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Contents
2222
:::
2323

2424
The process of preparing programs for a digital computer is especially
25-
attractive because it not only can be economically and scientifially
25+
attractive because it not only can be economically and scientifically
2626
rewarding, it can also be an aesthetic experience much like composing
2727
poetry or music. -- [Donald F. Knuth]{.smallcaps}
2828

_build/pages/vade_control.markdown

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ they don't need to refer to the same variable. If you want to test a
4848
single value against several possible outcomes, is probably a better
4949
option, see .
5050

51-
Several clauses can be nested. It's your resposibility to make sure than
51+
Several clauses can be nested. It's your responsibility to make sure than
5252
they are properly closed, especially when you're using many / branches.
5353

5454
If your »deserts are small«,[^1] and you don't have to process
@@ -112,7 +112,7 @@ Note that, compared to other programming languages, there are several
112112
limitations to the construct:
113113

114114
- No required or even allowed. This makes it impossible to achieve
115-
a »fallthrough« of several clauses (intentionally or
115+
a »fall through« of several clauses (intentionally or
116116
accidentally).
117117

118118
- There is no way to compare for inequality (like -- this would be an
@@ -137,14 +137,14 @@ other programming languages:
137137

138138
The keyword and the subsequent increment (which can be any expression,
139139
not necessarily only a variable) are optional; if they're missing, the
140-
increment is set to $1$. There is no need to add to the keyword the name
140+
increment is set to `1`. There is no need to add to the keyword the name
141141
of the loop variable.[^2]
142142

143143
The index loop variable will be set to the initial value , and the code
144144
inside the loop executed at least once. Upon reaching the corresponding
145145
statement, the index is compared to the limit given after the keyword.
146146
If the index is smaller or equal to , the index is incremented by the ,
147-
if this is provided, or by $1$), and the loop is traversed once more.
147+
if this is provided, or by `1`), and the loop is traversed once more.
148148
(If is negative, the situation is obviously reversed.)
149149

150150
This means that to traverse through a complete array (assuming it uses
@@ -241,8 +241,8 @@ repeated until an expression will be fulfilled. Note two important
241241
differences though:
242242

243243
- In a loop, the loop is executed as long as the expression is *true*
244-
(ie, unequal to $0$), whereas a loop is executed as long as the
245-
expression is *false*, or $0$.
244+
(ie, unequal to `0`), whereas a loop is executed as long as the
245+
expression is *false*, or `0`.
246246

247247
- In a loop, the test for the expression is performed at the
248248
*beginning* of the loop, but in a loop, the expression test takes
@@ -297,7 +297,7 @@ Exceptions:
297297
------------
298298

299299
Exceptions provide a fairly comfortable way to catch runtime errors
300-
occuring unexpectedly in your program. Of course, they can't help with
300+
occurring unexpectedly in your program. Of course, they can't help with
301301
faulty program logic. Rather, exceptions are supposed to handle files
302302
not conforming to an expected format, hardware problems and the like.
303303

@@ -335,7 +335,7 @@ to this variable (provided any error occured at all). The corresponding
335335
section will then be executed, regardless of the exact nature of the
336336
error.
337337

338-
The second option is thus preferrable if you either want to have a
338+
The second option is thus preferable if you either want to have a
339339
simple »catch all« which will deal with any imaginable error in a
340340
single sweep, or, at the other extreme, if the error conditions you
341341
expect to encounter are so confusing that you'd rather dedicate some

_build/pages/vade_data.markdown

Lines changed: 31 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ data it is fed with.
3939
Simple 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
4343
their 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
4646
admittedly looks a little silly.)
4747

@@ -80,16 +80,12 @@ Many languages have different types for various flavours of numbers --
8080
signed or unsigned integers, reals, etc. -- In contrast, SmallBASIC only has a
8181
single 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

8985
Strings are chains of one or several letters, used to represent words,
9086
sentences or complete texts. A string consisting of zero letters is
9187
called 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
9389
probably 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
10298
arbitrarily, and there is no need to define a maximum length for them. A
10399
theoretical 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
115111
right of it to a new, third string, the length of which is the sum of
116112
the individual strings' lengths. If either the left or the right operand
117113
is 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

151147
Note 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

155151
Complex data structures
156152
-----------------------
@@ -186,7 +182,7 @@ array member, its name is followed by the index in parentheses :
186182
hoogla(i)= boogla(250)
187183

188184
will assign the value of 's 250th member to the member of with the
189-
numberical index .
185+
numerical index .
190186

191187
Array members can be of **mixed content**, ie it's perfectly okay for
192188
one 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
206202
member of an array is deleted, then all array members with higher
207203
indices »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

218214
Arrays are not limited to being a chain of values. **Several array
219215
dimensions** can be defined to render arrays of &raquo;rectangular&laquo;,
@@ -222,17 +218,17 @@ dimensions** can be defined to render arrays of &raquo;rectangular&laquo;,
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
226222
one 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.
228224
Likewise, using the appendix operator with a higher-dimensional array
229225
should be avoided.[^12]
230226

231227
The maximum array size is virtually unlimited. But note that with the
232228
introduction of new array dimensions, the space and performance
233229
requirements increase exponentially.
234230

235-
### Maps [\[map\]]{#map label="map"}
231+
### Maps
236232

237233
Maps differ from arrays in two ways: Firstly, while arrays always have a
238234
linear or &raquo;rectangular&laquo; structure, **maps are &raquo;data trees&laquo;,
@@ -261,13 +257,13 @@ and thus to create havoc at runtime.
261257
**Map initialisation** can be done by in three ways: Either explicitly,
262258
by using the keyword *without* an array size (ie, simply is enough),
263259
through 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
265261
square 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

272268
To create more complex structures, each map member which is a map again
273269
must be enclosed in brackets. For example,
@@ -319,7 +315,7 @@ be a real value, or even a string:
319315
boogla("nuffda")= ...
320316

321317
The second option uses the &raquo;dot notation&laquo; familiar from other
322-
languages like &raquo;C&laquo;, seperating the name from the member key with a
318+
languages like &raquo;C&laquo;, separating the name from the member key with a
323319
dot :
324320

325321
boogla.nuffda= ...
@@ -358,35 +354,30 @@ When accessing in the third line, in the first term , is replaced with
358354
its value by the interpreter, before looking the map member with that
359355
name up and returning the result, . In the second term , the interpreter
360356
looks 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

363359
This makes the parentheses notation particularly useful when you want to
364360
decide at runtime which map member you want to access: With dot
365361
notation, access is fixed, but with parentheses notation you can pass a
366362
variable to determine which member to use in that instance.
367363

368-
### [\[cLen\]]{#cLen label="cLen"}
369-
370364
For both arrays and maps, will give you the number of elements in the
371365
structure. But note that this isn't the total number of elements, but
372366
only the number of elements in the &raquo;top dimension&laquo;.
373367

374368
For 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
467458
the two variables is broken, and the variables go their seperate ways.
468459
So, 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

_build/pages/vade_intro.markdown

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,10 @@ you when you want to get more closely acquainted with :
8989
Licenses
9090
--------
9191

92-
- SmallBASIC is released under the [GNU General Public License version 2.0
93-
(GPLv2)](http://www.gnu.org/licenses/old-licenses/gpl-2.0)
92+
- SmallBASIC is released under the [GNU General Public License version 2.0 (GPLv2)](http://www.gnu.org/licenses/old-licenses/gpl-2.0)
9493

9594
- This document, the &raquo;Vademecum&laquo;, is released under the
96-
[Creative Commons License
97-
by-nc-nd](http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en_GB).
95+
[Creative Commons License by-nc-nd](http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en_GB).
9896
In short, this license means that you are free to reproduce and
9997
distribute this document in any non-commercial manner, as long as
10098
you don't change the author's name (that's mine), and as long as the

_build/pages/vade_structure.markdown

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ also maintain their own &raquo;household&laquo; of variables accessible only
108108
to them.
109109

110110
The keyword is used to define variables &raquo;attached&laquo; to a routine.
111-
The variables come into existance the minute the routine is invoked, and
111+
The variables come into existence the minute the routine is invoked, and
112112
they're deleted again as soon as the routine is terminated. If a local
113113
variable (or a routine parameter) has the same name as variable
114114
previously defined (in the main program or a routine which called the
@@ -144,11 +144,11 @@ details from that of other programming languages and BASIC dialects:
144144
> In main: 100 99
145145

146146
Let's have a look at what is actually happening here. First, the global
147-
variables and are defined and assigned the values $100$ and $200$, resp.
147+
variables and are defined and assigned the values `100` and `200`, resp.
148148
Next, is invoked and defines a local variable which &raquo;shadows&laquo; the
149-
global variable of the same name. Thus, the value $30$ is assigned to
149+
global variable of the same name. Thus, the value `30` is assigned to
150150
the local instance of , not to the global one. As opposed to that, there
151-
only is one instance of , and the value $200$ is written to that.
151+
only is one instance of , and the value `200` is written to that.
152152

153153
Next, is called, which has access to all the &raquo;knowledge&laquo; has. When
154154
the old values of and are overwritten, this happens again to the local
@@ -176,8 +176,8 @@ create a new *global* variable first:
176176
> 10
177177

178178
This creates (or overwrites) a global variable with the name and the
179-
value $100$, then creates a local variable with the same name, assigns
180-
it the value $10$, and then destroys the local copy at the end of the
179+
value `100`, then creates a local variable with the same name, assigns
180+
it the value `10`, and then destroys the local copy at the end of the
181181
procedure, while the global copy still lives on.
182182

183183
Routines can **recurse**, ie invoke themselves again before they're
@@ -327,7 +327,7 @@ Think of it as a simple copy-paste operation.
327327
creation of genuine program libraries with their own namespace and
328328
well-defined interfaces.
329329

330-
Units are kept in seperate source files; each file contains exactly one
330+
Units are kept in separate source files; each file contains exactly one
331331
unit which bears the same name as the file *sans* the extension.[^6]
332332

333333
file hoogla.bas:
@@ -338,7 +338,7 @@ unit which bears the same name as the file *sans* the extension.[^6]
338338
zoogla= "Hello world!"
339339

340340
sub boogla(name)
341-
print "Goodybe", name, "!"
341+
print "Goodbye", name, "!"
342342
end
343343

344344
Inside the unit file, you can write code as you would in any source
@@ -350,7 +350,7 @@ keyword .
350350
First level code is executed when the library is loaded, but it takes
351351
place in a separate namespace, ie a variable called in the unit file
352352
will not conflict with a variable with the same name in the mother file;
353-
they're two seperate entities.
353+
they're two separate entities.
354354

355355
To use a unit, it must be first be compiled into bytecode. You can do so
356356
from the IDE, or use the command line:
@@ -375,7 +375,7 @@ With the above code segment from you get:
375375

376376
It should be painfully obvious that a unit can't import itself again.
377377

378-
[^1]: Most times a disctinction between &raquo;arguments&laquo; and
378+
[^1]: Most times a distinction between &raquo;arguments&laquo; and
379379
&raquo;parameters&laquo; is made in computer literature, but we'll treat
380380
both as synonyms.
381381

0 commit comments

Comments
 (0)