Lists

- XLogo

simple

Primitive Alt Action
First [list]
Last [list]
ButFirst [list]
ButLast [list]


BF
BL
Return first item of list.
Return last item of list.
Return all items except ( but ) first item of list.
Return all items except ( but ) last item of list.

Primitive Action
Count [list]
Pick [list]
Reverse [list]
Item : n [list]
FPut : n [list]
LPut : n [list]
AddItem [list] : n : m
SetItem [list] : n : m
Remove : n [list]
Member : n [list]
Return count of number of items in list.
Return one item pick ed at random from list.
Return list with items in reverse order.
Return item in position n of list.
Return list with item n put (added) into f irst position.
Return list with item n put (added) into l ast position.
Return list with item m add ed in position n.
Return list with item in position n set to m.
Return list with every item n remove d.
Return sublist from first instance of member n to end of list, else return false.

Property Lists

Primitive Alt Action
PutProperty name key value
GetProperty name key
RemoveProperty name key
PropertyList
name
PProp
GProp
RProp
PList
Add property (key-value pair) to the property list.
Return the value associated with the key.
Remove the key-value pair from the property list.
Display all key-value pairs in the property list.

Workspace

Primitive Alt Action
Primitives
Procedures
PropertyLists
Turtles
Variables

Procs
PLs


Vars
Return a list of all primitives in current language.
Return a list of all procedure names.
Return a list of all property list names currently defined.
Return a list of all turtle numbers on screen. (See Multi T )
Return a list of currently defined variable names.
Contents   Return a list of all procedures, variables and property lists.

Note

  1. Replace is an alternative to SetItem .
  2. Property lists names are case sensitive. A property list can have the same name as another list or variable.