next up previous contents index
Next: Procedures Up: Conventions adopted by XLOGO Previous: Conventions adopted by XLOGO   Contents   Index

Commands and their interpretation

The LOGO language allows certain events to be triggered by internal commands - these commands are called primitives. Each primitive may have a certain number of parameters which are called arguments. For example, the primitive cs , which clears the screen, takes no arguments, while the primitive sum takes two arguments.

print sum 2 3 will return 5.

LOGO arguments are of three kinds:

Numbers are treated in some instances as a numeric value (eg: fd 100), and in others as a word (eg: print empty? 12 writes false).

Several primitives have a general form, it means they could be used with an undefined number of arguments. All those primitives are on the table below:

print sum product or
and list sentence word
To notice to the interpreter that those primitive will be used in their general form, we have to write our command into parenthesis, look at those examples below:
 print (sum 1 2 3 4 5)
15

(list [a b] 1 [c d])
I don't know what to do with [[a b] 1 [c d]]?

if (and 1=1 2=2 8=5+3) [fd 100 rt 90]


next up previous contents index
Next: Procedures Up: Conventions adopted by XLOGO Previous: Conventions adopted by XLOGO   Contents   Index
Loïc 2008-06-08