How to say words and lists
Help Contents
First Steps In Logo
How to say words and lists
How to say words and lists
Imagine you want to give an instruction to Logo to print a house. A computer are not as smart as you might think it is, so it cannot decide what exactly you ask for: to print the image of a house or to print the word 'house'.
That's why when you write programs it is very polite to give hints to Logo as to how to treat ambigious words.
If you want to use a word as a standard natural language word (for example when you want to print it), then you say a double quote " before the word.
"cat, "X, "Case23
are treated as the words 'cat', 'X' and 'Case23'.
If you say cat instead of "cat then this will ask Logo to use it as an action (action is a synonym of instruction). Actions are described later.
Logo numbers are infact words. That's why you can say " before them. Apparently when reading a number Logo knows that it cannot refer to an action, that's why it does not really need the quatation mark. As a result, you can say numbers directly:
56, 31.8, -300.
Like numbers, lists are unambigious too. When you want to say a list, you just say it as it is but do not forget to put [...] otherwise Logo will not understand that this is a list.