Terrapin Resources

Terrapin Logo 4 has been discontinued! Our new Terrapin Logo version is much more powerful and modern; we strongly recommend that you update to our latest release of the Logo programming language.

Contents lists

Contents list commands manipulate several items at once using structured contents lists. Such a list is a three-element list, which are again lists. The first element is a list of all affected procedures, the seconds a list of all names, and the third a list of all properties. Structured contents lists are a new feature of Terrapin Logo 4; almost all commands in this section have changed from Terrapin Logo 3.

ALL

Also: CONTENTS, CO

Outputs a complete structured contents list.

Syntax

Description

ALL outputs a structured contents list containing all user-defined, unburied procedures names, names, and property list names. The list is a three-element list; the first element is a list of all procedure names, the second a list of all names, and the third element is a list of all property list names.

Many commands accept a structured contents list as input. This makes it possible to supply a targeted collection of procedure names, names, and property lists. For example, the list [[] [MYNAME] []] would refer to the name MYNAME, and the list [[MYPROC] [] [A B]] would refer to the procedure MYPROC, and the property list A and B.

Example

(PR “Procedures: ITEM 1 ALL) Procedures: SQUARE NICKNAME (PR “Names: ITEM 2 ALL) Names: (PR “Propertylists: ITEM 3 ALL) Propyertylists: JOE JACK

BURIED

Outputs a structured contents list of all buried elements.

Syntax

Description

BURIED outputs a structured contents list of all buried, non-empty elements.

Example

MAKE “N 1 BURYNAME “N BURIED

BURIED?

Also: BURIEDP

Outputs TRUE if the element described by its input is buried.

Syntax

Description

BURIED outputs TRUE if the element described by its input is buried. If the input is a list or a structured contents list, BURIED? outputs the buried state of the first non-empty element of the list.

BURIEDNAMES

Outputs a list of all buried names.

Syntax

Description

BURIEDNAMES outputs a list of all buried names. BURIEDNAMES is an abbreviation for FIRST BUTFIRST BURIED

Example

MAKE “N 1 BURYNAME “N BURIEDNAMES Result: [N]

BURIEDPROCS

Outputs a list of all buried procedures.

Syntax

Description

BURIEDPROCS outputs a list of all buried procedures. BURIEDPROCS is an abbreviation for FIRST BURIED

BURIEDPROPS

Outputs a list of all buried property lists.

Syntax

Description

BURIEDPROPS outputs a list of all buried property lists. BURIEDPROPS is an abbreviation for LAST BURIED

Example

PPROP “STAN “AGE “YOUNG BURYPROP “STAN BURIEDPROPS Result: [STAN]

BURY

Makes names and procedures invisible.

Syntax

Description

BURY hides the object(s) specified by its input from the general Logo workspace. Buried elements are like primitives. They are not listed anymore with any of the commands that return lists of elements, like PROCEDURES. The PRINTOUT

command does not list their content. See also BURIEDNAMES, BURIEDPROCS, BURIEDPROPS, BURYALL, BURYNAME, BURYPROC, and BURYPROP.

Example

MAKE “B 456 PON “B B is 456 BURY NAMELIST “B PON “B UNBURY NAMELIST “B PON “B B is 456

BURYALL

Makes all names and procedures invisible.

Syntax

Description

BURYALL makes all names and procedures invisible. BURYALL is an abbreviation for BURY ALL.

BURYNAME

Makes one or more names invisible.

Syntax

Description

BURYNAME makes either a single name or a list of names invisible. BURYNAME is an abbreviation for BURY NAMELIST name-or-list.

BURYNAMES

Makes all names invisible.

Syntax

Description

BURYNAMES makes all names invisible. BURYNAMES is an abbreviation for BURY NAMES.

BURYPROC

Makes one or more procedures invisible.

Syntax

Description

BURYPROC makes either a single procedure or a list of procedures invisible. BURYPROC is synonymous to BURY.

BURYPROCS

Makes all procedures invisible.

Syntax

Description

BURYPROCS makes all procedures invisible. BURYPROCS is an abbreviation for BURY PROCEDURES.

BURYPROP

Makes one or more property lists invisible.

Syntax

Description

BURYPROP makes either a single property list or a list of property lists invisible. BURYPROP is synonymous to BURY PLLIST name-or-list.

BURYPROPS

Makes all property lists invisible.

Syntax

Description

BURYPROPS makes all property lists invisible. BURYPROPS is an abbreviation for BURY PLISTS.

EDALL

Edits the entire Logo workspace.

Syntax

Description

EDALL loads all of the unburied Logo procedures, names, and properties into a new editor window. EDALL is an abbreviation for EDIT ALL.

EDIT

Also: ED

Edits parts or all of the Logo workspace.

Syntax

Description

EDIT prints its inputs and opens the resulting data in an editor window. For procedures, EDIT attempts to open the original file that contained the definition of that procedure; if this is not possible, or if the procedure has never been saved before, EDIT prints the procedure instead. EDIT then prints the names and/or properties, and opens an editor window containing all printed definitions. EDIT only prints unburied data; see BURY for an explanation of buried data.

If multiple procedures are given as input to EDIT, EDIT attempts to open all files that are associated with the procedures, and switches the editor window to the first procedure, unless EDIT also caused the editor window to open a new window with printed data; in that case, the editor window displays the contents of the new window.

EDIT ALL opens the editor and installs all the unburied procedures, names, and property lists that exist in the workspace. EDIT NAMES opens the editor and installs all the user-defined names in the workspace (names defined with MAKE). EDIT PROCEDURES opens the editor with the contents of all the user-defined procedures in the workspace. EDIT PLISTS opens the editor with the contents of all the user-defined properties in the workspace.

EDIT can also be used with a three-element contents list as its input (NAMES, PROCEDURES and PLISTS all output a structured contents list). EDIT edits all procedures, names and properties mentioned in that contents list.

If EDIT is called with a single property list element as in EDIT [[][][PREFS]], a property editory opens that lets you edit the properties of that element interactively.

(EDIT) opens an empty editor window.

EDL

Edits a list.

Syntax

Description

EDL stands for EDit List. EDL causes the visual list editor to appear with the contents of the specified list organized by ITEM number. Contents of the list may be edited in the visual list editor. Click OK to replace the list in workspace with the edited list.

Example

MAKE “MONTHS [JANUARY FEBRUARY MARCH APRIL MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOVEMBER DECEMBER] EDL “MONTHS

EDN

Edits one or more Logo names.

Syntax

Description

EDN loads the unburied Logo name or the list of unburied Logo names into a new editor tab. EDN is an abbreviation for EDIT NAMELIST name-or-list.

In Terrapin Logo, EDN with no inputs used to edit all names. Please use EDNS instead.

EDNS

Edits all Logo names.

Syntax

Description

EDNS loads all of the unburied Logo names into a new editor window. EDNS is an abbreviation for EDIT NAMES.

EDP

Edits one or more Logo procedures.

Syntax

Description

EDP loads the unburied Logo procedure or the list of unburied Logo procedures into a new editor window. EDP is an abbreviation for EDIT PROCLIST name-or-list.

Note: In Terrapin Logo 3, the command to edit a property list was EDP. Now, use the EDPL command to edit a property list.

EDPL

Edits one or more Logo property lists.

Syntax

Description

EDPL loads the unburied property list or the list of unburied property lists into a new editor window. EDPL is an abbreviation for EDIT PLLIST name-or-list.

If EDPL is called with a single name as input, a property editory opens that lets you edit the properties of that name interactively.

Note: In Terrapin Logo 3, the command to edit a property list was EDP, which now edits one or more procedures.

EDPS

Edits all user-defined, unburied procedures.

Syntax

Description

EDPS loads user-defined, unburied procedures into a new editor window. EDPS is an abbreviation for EDIT PROCEDURES.

EDPLS

Edits all Logo properties.

Syntax

Description

EDPLS loads all of the unburied Logo properties into a new editor tab. EDPLS is an abbreviation for EDIT PLISTS.

ERALL

Edits the entire Logo workspace.

Syntax

Description

ERALL erases the unburied Logo procedures, names, and properties. ERALL is an abbreviation for ERASE ALL.

ERASE

Also: ER

Erases Logo elements.

Syntax

Description

ERASE removes the definition of its input from the workspace. The input to ERASE must be an quoted procedure name or list of procedure names. It can also be a structured contents list (see ALL). ERASE erases all definitions of a name, including its aliases defined with theALIAS command, regardless whether the original name or an alias name is used as input. ERASE NAMES removes all user-defined names from the workspace. ERASE PROCEDURES removes all procedures from the workspace. ERASE PLISTS removes all property lists from the workspace. ERASE ALL removes all procedures and names from the workspace.

Use ERASE to erase Logo objects as well. Once created, Logo objects like turtles or bitmaps, live forever unless you erase them. Use the ERASE command just as you would use it to erase procedures. The command ERASE “TURTLE.0, for example, erases the turtle 0.

ERN

Erase one or more Logo names.

Syntax

Description

ERN erases the unburied Logo name or the list of unburied Logo names. ERN is an abbreviation for ERASE NAMELIST name-or-list.

Note that ERN with no inputs used to erase all names. Please use ERNS instead.

ERNS

Erases all Logo names.

Syntax

Description

ERNS erases all of the unburied Logo names. ERNS is an abbreviation for ERASE NAMES.

ERPL

Erases one or more Logo property lists.

Syntax

Description

ERPL erases the unburied Logo property list or the list of unburied Logo property lists. ERPL is an abbreviation for ERASE PLLIST name-or-list.

ERPLS

Erases all Logo properties.

Syntax

Description

ERPLS erases all of the unburied Logo properties. ERPLS is an abbreviation for ERASE PLISTS.

ERPS

Erases all procedures.

Syntax

Description

ERPS erases all unburied Logo procedures. ERPS is an abbreviation for ERASE PROCEDURES.

NAMELIST

Outputs a structured contents list with names.

Syntax

Description

NAMELIST outputs its input as a structured contents list. Its input is converted to a list if it is not a list, and the output contains that list as its second element. The first and third elements are the empty list. NAMELIST can be used to input a structured list of names to procedures that accept a contents list.

Example

NAMELIST “HI Result: [[][HI][]] NAMELIST [HI WORLD] Result: [[][HI WORLD][]]

NAMES

Outputs a structured contents list with all names.

Syntax

Description

NAMES outputs a structured contents list containing all user-defined, unburied names. The list is a three-element list; the first element is an empty list, the second is a list of all names, and the third element is again an empty list.

Example

NAMES Result: [[][N SIZE]]

PLISTS

Also: PROPERTIES

Outputs a structured contents list with all properties.

Syntax

Description

PLISTS outputs a structured contents list containing all user-defined, unburied properties. The list is a three-element list; the first and second elements are empty lists, and the third element is a list of all names that have properties.

Example

PPROP “CAR “MAKE “BMW PROPERTIES Result: [[][][CAR]]

PLLIST

Outputs a structured contents list with properties.

Syntax

Description

PLLIST outputs its input as a structured contents list. Its input is converted to a list if it is not a list, and the output contains that list as its third element. The first and second elements are the empty list. PLLIST can be used to input a structured list of property list names to procedures that accept a contents list.

Example

PLLIST “HI Result: [[][][HI]] PLLIST [HI WORLD] Result: [[][][HI WORLD]]

POALL

Prints the entire Logo workspace.

Syntax

Description

POALL prints the unburied Logo procedures, names, and properties. POALL is an abbreviation for PRINTOUT ALL.

PON

Prints a Logo name.

Syntax

Description

PON prints the name given by its first input if it is unburied.

Example

MAKE “N 1 PON “N N is 1

PONS

Prints all Logo names.

Syntax

Description

PONS prints all of the unburied Logo names. PONS is an abbreviation for PRINTOUT NAMES.

POPL

Prints one or more Logo property lists.

Syntax

Description

POPL prints the unburied Logo property list or the list of unburied Logo property lists. POPL is an abbreviation for PRINTOUT PLLIST name-or-list.

POPLS

Prints all Logo properties.

Syntax

Description

POPLS prints all of the unburied Logo properties. POPLS is an abbreviation for PRINTOUT PLISTS.

POPRS

Prints the title of all Logo primitives.

Syntax

Description

POPRS prints the title of all built-in Logo primitives. POPRS is an abbreviation for PRINTOUT PRIMITIVES.

POPS

Prints all Logo procedures.

Syntax

Description

POPS prints all stored procedure definitions. POPS is an abbreviation for PRINTOUT PROCEDURES.

POT

Prints the title line of one or more user-defined procedures.

Syntax

Description

POT prints the titles of one or more user-defined procedures. To print out procedure definitions, use PRINTOUT.

POTS

Prints the title line of all user-defined procedures.

Syntax

Description

POTS prints the titles of all user-defined procedures. To print out procedure definitions, use POPS. POTS is an abbreviation for POT PROCEDURES.

PRIMITIVES

Outputs a structured contents list with all primitives.

Syntax

Description

PRIMITIVES outputs a structured contents list containing all built-in procedure names. The list is a three-element list; the first element is a list of all procedure names, and the second and third elements are the empty list.

PRINTOUT

Also: PO

Prints procedures, names, or properties.

Syntax

Description

PRINTOUT prints the names, definitions, and values specified by its input.

PRINTOUT ALL prints out all procedure titles, definitions, variable names and values, and property lists. PRINTOUT ALL can be abbreviated to PO ALL.

PRINTOUT NAMES prints out all user-defined variable names and values. PRINTOUT NAMES can be abbreviated to PO NAMES or PONS.

PRINTOUT PROCEDURES prints out all user-defined procedure titles and definitions. PRINTOUT PROCEDURES can be abbreviated to PO PROCEDURES or POPS.

PRINTOUT PRIMITIVES prints out all built-in procedure titles. PRINTOUT PRIMITIVES can be abbreviated to PO PRIMITIVES or POPRS.

PRINOUT also accepts a structured content list, and prints all elements in that list.

PROCEDURES

Outputs a list with all user procedures.

Syntax

Description

PROCEDURES outputs a list containing all user-defined, unburied procedure names. Note that this is not a structured contents list, but all commands that accept such a list can also work with the list returned by PROCEDURES. Use PROCLIST to get a structured contents list.

Example

PROCEDURES Result: [SQUARE TRIANGLE]

PROCLIST

Outputs a structured contents list with procedures.

Syntax

Description

PROCLIST outputs its input as a structured contents list. Its input is converted to a list if it is not a list, and the output contains that list as its first element. The second and third elements are the empty list. PROCLIST can be used to input a structured list of procedures to procedures that accept a contents list.

Example

PROCLIST “HI Result: [[HI][][]] PROCLIST [HI WORLD] Result: [[HI WORLD][][]]

UNBURY

Makes names and procedures visible.

Syntax

Description

UNBURY returns the object(s) specified by its input to the general Logo workspace. UNBURY operates on procedures, names, and/or property lists previously buried with the BURY, BURYNAME, BURYPROC or BURYPROP commands. See also BURIEDNAMES, BURIEDPROCS, BURIEDPROPS, UNBURYALL, UNBURYNAME, UNBURYPROC, and UNBURYPROP.

Built-in commands cannot be unburied.

Example

MAKE “B 456 PON “B B is 456 BURY NAMELIST “B PON “B UNBURY NAMELIST “B PON “B B is 456

UNBURYALL

Makes all names and procedures visible.

Syntax

Description

UNBURYALL makes all names and procedures visible. UNBURYALL is an abbreviation for UNBURY BURIED.

UNBURYNAME

Makes one or more names visible.

Syntax

Description

UNBURYNAME makes either a single name or a list of names visible. UNBURYNAME is an abbreviation for UNBURY NAMELIST name-or-list.

UNBURYNAMES

Makes all names visible.

Syntax

Description

UNBURYNAMES makes all names visible. UNBURYNAME is an abbreviation for UNBURY NAMELIST BURIEDNAMES.

UNBURYPROC

Makes one or more procedures visible.

Syntax

Description

UNBURYPROC makes either a single procedure or a list of procedures visible. UNBURYPROC is an abbreviation for UNBURY PROCLIST name.

UNBURYPROCS

Makes all procedures visible.

Syntax

Description

UNBURYPROCS makes all procedures visible. UNBURYPROCS is an abbreviation for UNBURY BURIEDPROCS.

UNBURYPROP

Makes one or more property lists visible.

Syntax

Description

UNBURYPROP makes either a single property list or a list of property lists visible. UNBURYPROP is synonymous to UNBURY PLLIST name-or-list.

UNBURYPROPS

Makes all property lists visible.

Syntax

Description

UNBURYPROPS makes all property lists visible. UNBURYPROPS is an abbreviation for UNBURY NAMELIST BURIEDPROPS.