ucbcompat
The ucbcompat module is accessible via the pylogo module.
Attributes
Functions
f array(size, origin=1) ...
ARRAY size (ARRAY size origin)
outputs an array of size members (must be a positive integer), each of which initially is an empty list. Array members can be selected with ITEM and changed with SETITEM. The first member of the array is member number 1 unless an origin input (must be an integer) is given, in which case the first member of the array has that number as its index. (Typically 0 is used as the origin if anything.)
f mdarray(sizelist, origin=1) ...
MDARRAY sizelist (MDARRAY sizelist origin)
outputs a multi-dimensional array. The first input must be a list of one or more positive integers. The second input, if present, must be a single integer that applies to every dimension of the array. Ex: (MDARRAY [3 5] 0) outputs a two-dimensional array whose members range from [0 0] to [2 4].
f listtoarray(lst, origin=1) ...
LISTTOARRAY list (LISTTOARRAY list origin)
outputs an array of the same size as the input list, whose members are the members of the input list.
f arraytolist(array) ...
ARRAYTOLIST array
outputs a list whose members are the members of the input array. The first member of the output is the first member of the array, regardless of the array's origin.
f mditem(indexlst, array) ...
MDITEM indexlist array
outputs the member of the multidimensional array selected by the list of numbers indexlist.
f quoted(v) ...
QUOTED thing
outputs its input, if a list; outputs its input with a quotation mark prepended, if a word.
f mdsetitem(indexlst, array, value) ...
MDSETITEM indexlist array value
command. Replaces the member of array chosen by indexlist with the new value.
f dotsetitem(index, array, value) ...
.SETITEM index array value
command. Changes the index``th member of ``array to be value, like SETITEM, but without checking for circularity. WARNING: Primitives whose names start with a period are DANGEROUS. Their use by non-experts is not recommended. The use of .SETITEM can lead to circular arrays, which will get some Logo primitives into infinite loops; and the loss of memory if a circular structure is released.
f push(interp, stackname, thing) ...
PUSH stackname thing
command. Adds the thing to the stack that is the value of the variable whose name is stackname. This variable must have a list as its value; the initial value should be the empty list. New members are added at the front of the list.
f pop(interp, stackname) ...
POP stackname
outputs the most recently PUSHed member of the stack that is the value of the variable whose name is stackname and removes that member from the stack.
f queue(interp, queuename, thing) ...
QUEUE queuename thing
command. Adds the thing to the queue that is the value of the variable whose name is queuename. This variable must have a list as its value; the initial value should be the empty list. New members are added at the back of the list.
f dequeue(interp, queuename) ...
DEQUEUE queuename
outputs the least recently QUEUEd member of the queue that is the value of the variable whose name is queuename and removes that member from the queue.
f rawascii(c) ...
RAWASCII char
outputs the integer (between 0 and 255) that represents the input character in the ASCII code.
f setprefix(s) ...
SETPREFIX string
command. Sets a prefix that will be used as the implicit beginning of filenames in OPENREAD, OPENWRITE, OPENAPPEND, OPENUPDATE, LOAD, and SAVE commands. Logo will put the appropriate separator character (slash for Unix, backslash for DOS/Windows, colon for MacOS) between the prefix and the filename entered by the user. The input to SETPREFIX must be a word, unless it is the empty list, to indicate that there should be no prefix.
f openread(filename) ...
OPENREAD filename
command. Opens the named file for reading. The read position is initially at the beginning of the file.
f openwrite(filename) ...
OPENWRITE filename
command. Opens the named file for writing. If the file already existed, the old version is deleted and a new, empty file created.
f openappend(filename) ...
OPENAPPEND filename
command. Opens the named file for writing. If the file already exists, the write position is initially set to the end of the old file, so that newly written data will be appended to it.
f openupdate(filename) ...
OPENUPDATE filename
command. Opens the named file for reading and writing. The read and write position is initially set to the end of the old file, if any. Note: each open file has only one position, for both reading and writing. If a file opened for update is both READER and WRITER at the same time, then SETREADPOS will also affect WRITEPOS and vice versa. Also, if you alternate reading and writing the same file, you must SETREADPOS between a write and a read, and SETWRITEPOS between a read and a write.
f allopen() ...
ALLOPEN
outputs a list whose members are the names of all files currently open. This list does not include the dribble file, if any.
f erasefile(filename) ...
ERASEFILE filename ERF filename
command. Erases (deletes, removes) the named file, which should not currently be open.
f dribble(filename) ...
DRIBBLE filename
command. Creates a new file whose name is the input, like OPENWRITE, and begins recording in that file everything that is read from the keyboard or written to the terminal. That is, this writing is in addition to the writing to WRITER. The intent is to create a transcript of a Logo session, including things like prompt characters and interactions.
f pprop(plistname, propname, value) ...
PPROP plistname propname value
command. Adds a property to the plistname property list with name propname and value value.
f gprop(plistname, propname) ...
GPROP plistname propname
outputs the value of the propname property in the plistname property list, or the empty list if there is no such property.
f remprop(plistname, propname) ...
REMPROP plistname propname
command. Removes the property named propname from the property list named plistname.
f plist(plistname) ...
PLIST plistname
outputs a list whose odd-numbered members are the names, and whose even-numbered members are the values, of the properties in the property list named plistname. The output is a copy of the actual property list; changing properties later will not magically change a list output earlier by PLIST.
f plistp(plistname) ...
PLISTP name PLIST? name
outputs TRUE if the input is the name of a nonempty property list. (In principle every word is the name of a property list; if you haven't put any properties in it, PLIST of that name outputs an empty list, rather than giving an error message.)
f erpls() ...
ERPLS
command. Erases all unburied property lists from the workspace. Abbreviates ERASE PLISTS.
Classes
C UCBArray(...) ...
This class contains 22 members.
See the source for more information.