5.1 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:

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

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 notify the interpreter that these primitives 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)  
(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]