Word, number, boolean value
Word (a string of characters) is a fundamental type in LOGO. Words inserted in the code are preceded by
quotation marks: "word
, except the declaration of list items:
[word1 word2 word3]
,
array items: {word1 word2 1.1 23}
,
and names in the abbreviated access to variables: :name1
, turtles:
#name2
and functions: $name3
.
A word used as a constant in the code can contain reserved symbols, it just needs to be surrounded with
"|" symbols, e.g.: "|C:\My Documents|
Numbers in POOL are stored as 64-bit floating point numbers. Integer operations are performed internally
on integer types (e.g. loop iteration counter repcount
or
indexing an item in a collection), but the result is always a floating point number. The following identifiers of
constants are recognized:
m_pi = 3.14159265358979
m_exp = 2.71828182845905
.
Boolean values are the constants: true
and
false
.
Words can be used interchangeably with numbers and boolean values, LOGO can recognize the meaning of input data
by the context of expressions. Constants are appropriately converted during compilation whenever it is possible
to anticipate the conversion.
Note: boolean values are not equivalent to the numerical values of 0 and 1.
Example:
print 1 + "1
print item 3 m_pi
Output:
2
1
See also:
Table of Content