This section contains all commands that put together Logo words or lists, or access elements of Logo words or lists.
Prepends an element to its input.
FPUT word word FPUT word list FPUT list list
FPUT reports the word or list that is created by putting the first input at the beginning of the second input.
If both inputs are words, FPUT reports a word; otherwise it reports a list. See also
FPUT "A "BC Result: ABC FPUT 1 23 Result: 123 FPUT "A [GREEN CHEVY] Result: [A GREEN CHEVY] FPUT [NORTH DAKOTA] [NEW HAMPSHIRE] Result: [[NORTH DAKOTA] NEW HAMPSHIRE]
Outputs a list of sequential integers.
ISEQ from to (ISEQ from to increment)
ISEQ outputs a list of the integers from FROM to TO, inclusive. If an increment is given as an optional third input, the integers are created using the given increment; if no increment is given, the increment is 1 if FROM is less than TO, or -1 if FROM is greater than TO. Note that if the increment is not 1 or -1, the TO value may not be part of the list; for example, the output of (ISEQ 1 5 3) would not contain the value 5, because the next value to add would have been 6 instead of 5.
Concatenates its inputs to a list.
LIST object1 object2 (LIST object1 object2 object3 ...)
LIST reports a list composed of its inputs. The inputs to LIST can be either words or lists. If the inputs to LIST
are themselves lists, LIST preserves them as lists. LIST expects two inputs, but can accept more or less if it and all its
inputs are enclosed in parentheses. See also
To create a list enclosed in parentheses, use the
LIST "NORTH "CAROLINA Result: [NORTH CAROLINA] LIST [TO BE] [OR NOT TO BE] Result: [[TO BE] [OR NOT TO BE]]
Appends an element to its input.
LPUT word word LPUT word list LPUT list list
LPUT reports a new object that is created by placing the first input at the end of the second input. The inputs
to LPUT can be either words or lists. If the first input is a list, the second cannot be a word. If both inputs
are words, LPUT reports a word. See also
LPUT "ISSIPPI "MISS Result: MISSISSIPPI LPUT [COLORADO] [MISS] Result: [MISS [COLORADO]] LPUT FIRST [X Y Z] [A B C D] Result: [A B C D X]
Parses a string and outputs a list.
PARSE reads its input and converts it to a list.
The Listener procedure that Logo uses to evaluate user input is roughly written as:
TO LISTENER RUN PARSE READQUOTE LISTENER END
Outputs a list of equally spaced rational numbers.
RSEQ from to count
RSEQ outputs a list of COUNT equally spaced rational numbers between FROM and TO, inclusive.
Concatenates its inputs to a list, flattening lists.
SENTENCE object1 object2 (SE object1 object2 object3 ...)
SENTENCE reports a list made up of its inputs. SENTENCE expects two inputs, but will accept more
if it and all of its inputs are enclosed in parentheses. If the inputs to SENTENCE are lists, their brackets are
removed and combined into one list. See also
SENTENCE "NICEST "MONTH Result: [NICEST MONTH] SENTENCE [APRIL IS THE][NICEST MONTH] Result: [APRIL IS THE NICEST MONTH]
Substitutes text in a word or a list.
SUBST what with wordorlist
SUBST performs a replacement of text in its arguments. It replaces all occurrences of its first input with its second input inside the word or list given as its third input. If the third input is a list, the replacement is recursive and affects all lists inside the list. If the list element to be replaced is quoted, the replaced text remains quoted. In the same way, leading colons are preserved.
Quotes and colons are preserved.
SUBST "JUNK "NEW [A JUNK BOX] Result: [A NEW BOX] SUBST "? "X "A?B?C Result: AXBXC SUBST "? "MIKE [HELLO ? [HOW ARE YOU ?]] Result: [HELLO MIKE [HOW ARE YOU MIKE]]
Concatenates its inputs to a word.
WORD object1 object2 (WORD object1 object2 object3 ...)
WORD contatenates its inputs, which must not be lists, to a single word.
Concatenates its inputs to a parenthesized list.
XLIST object1 object2 (XLIST object1 object2 object3 ...)
XLIST reports an executable list composed of its inputs. The inputs to XLIST can be either words or lists. If the inputs to XLIST are themselves lists, XLIST preserves them as lists. XLIST expects two inputs, but can accept more or less if it and all its inputs are enclosed in parentheses.
An executable list is a list enclosed in parentheses. To create a normal list, use the
This example creates a runlist containing a
SENTENCE command with three instead of two inputs. This commands needs to be enclosed in parentheses so Logo can pick up all inputs.
(LIST (XLIST "SENTENCE 1 2 3)) Result: [(SENTENCE 1 2 3)] RUN (LIST (XLIST "SENTENCE 1 2 3)) Result: [1 2 3]