Foreign Translations


The following translations from other languages may help you to get oriented in the land of SenseTalk.
% {#}
The %
symbol is used in many languages as a 'modulo' operator, and is most commonly used to test whether a number is even or odd, or is evenly divisible by some number. SenseTalk has mod
and rem
operators for the general case. The more common divisibility tests are written like this:
if x is an even number then
…if x is divisible by 10 then
…if x is a multiple of 25 then
…
For more information, see Is a Multiple Of, Is Divisible By Operators.
=, ==, !=
Many languages use the =
symbol for assignment and ==
to test for equality. In SenseTalk =
(or the words is
, are
, equals
, is equal to
, etc.) means equals and the symbols ==
and !=
are not used. The put
and set
commands are used for assignment. For more information, see Comparison Operators and Storing into Containers.
++, --, +=, -=
These symbols are used in many languages for incrementing or decrementing a variable, or adding or subtracting an amount from a variable. In SenseTalk, the add
and subtract
commands are used:
add 1 to x -- increment
subtract 1 from x -- decrement
add foo to x -- add an amount
subtract foo from x -- subtract an amount
For more information, see Arithmetic Commands.
nil, null
In other languages these terms are used to indicate something that does not have an assigned value. In nearly all cases, SenseTalk uses empty
for this purpose. The fact that empty is an empty string (the same as ""
) may seem odd, but in practice it works very well (if this really bothers you, perhaps it will help to think of a variable as a box: when the box has nothing in it, it is empty; but the box is still there). For the rare cases when it is important to distinguish between empty
and the complete absence of a value (primarily when working with databases, or converting to or from JSON or XML-RPC objects), SenseTalk also has the value missing value
(and its synonyms, nil
and null
). The rarely-used term nullChar
represents the null character (the same as numToChar(0)
).
array, matrix, list
A "list" in SenseTalk is a variable-length sequential collection which may contain any mixture of values, including other lists. Use the terms item
or items
to refer to items in the list. SenseTalk lists use a sparse array implementation, so storing a value into item 1000000 of a list uses no more memory than storing into item 100.
hash, hash table, dictionary, associative array
A "property list" or "object" in SenseTalk is a collection of keys and values.