home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / powerlogo_377.lzh / PowerLOGO / LOGO-User-Guide < prev    next >
Text File  |  1990-10-10  |  40KB  |  1,210 lines

  1.  
  2.    Power LOGO
  3.    Release 1.0
  4.    by  Gary Teachout
  5.  
  6.  
  7. DISTRIBUTION            * * * * * * * * * * * * * * * * * * * * * *
  8.  
  9.    Copyright 1990 by Gary Teachout
  10.  
  11.    This program is freeware, and may be distributed freely. It may be
  12. distributed on any media, and included with other freely distributable
  13. software. It may not be distributed in any modified form. It may not be
  14. sold for profit, or included as part of a commercial software product. No
  15. donations are required but they would be appreciated.
  16.  
  17.  
  18. DISCLAIMER              * * * * * * * * * * * * * * * * * * * * * *
  19.  
  20.    THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
  21. EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO ITS FITNESS FOR ANY
  22. PARTICULAR PURPOSE. This software is experimental and IT HAS DEFECTS, if
  23. you do not accept all of the risks and responsibilities of using defective
  24. software, then DO NOT USE THIS.
  25.  
  26.  
  27. POWER LOGO?             * * * * * * * * * * * * * * * * * * * * * *
  28.  
  29.    Power LOGO is an experimental programming language based on Lisp and
  30. LOGO. It is versatile, highly interactive, organizes programs as
  31. collections of procedures, and includes lists as first-class data objects.
  32. My goal is to develop a language with the power and versatility of Lisp,
  33. the readablity of LOGO, plus access to the features of the Amiga.
  34.  
  35. Some features of Power LOGO:
  36.    Case sensitive.
  37.    Demons (exceptions) triggered by keyboard, menus, mouse.
  38.    Extra primitives:
  39.       arithmetic (frac, log, power...). 
  40.       control (cond, dowhile, whenmenu, while...).
  41.       graphics (openscreen, closescreen, openwindow...).
  42.       words and lists (items, repitem, represt...).
  43.    Menus under program control.
  44.    Not line sensitive.
  45.    Procedures are just a special type of list.
  46.    Procedures may have optional inputs.
  47.    Properties are just a special type of list.
  48.    Screens and windows under program control.
  49.    Turtles, as many as you like.
  50.  
  51.    With the following important exceptions Power LOGO is highly compatible
  52. with traditional LOGO.
  53.    Procedures are just a special type of list, no "to" or "end" primitive.
  54. This allows procedures to be processed as data.
  55.    Prefix (Polish) syntax only, no infix arithmetic, no special delimiters,
  56. no exeptions.
  57.    Spaces are never optional. Spaces must be used to separate words, list
  58. brackets, and parenthesis.
  59.    It is case sensitive, all primitives and keywords are lower case.
  60.    Graphic objects (screens, windows, and turtles) must be opened before
  61. use, and accessed through pointers.
  62.    No built-in text editor. To define procedures, you may type them at the
  63. command window, or use your favorite text editor and the "load" command.
  64.  
  65.  
  66. GETTING STARTED         * * * * * * * * * * * * * * * * * * * * * *
  67.  
  68.    LOGO may be run in the usual way from the WorkBench or the CLI. You may
  69. exit LOGO by entering the quit command.
  70.    If the current directory contains a file called LOGO-Startup it is
  71. loaded to initialize LOGO. This file contains LOGO code that may be used to
  72. configure LOGO the way you like, and to load your own frequently used
  73. procedures, and data.
  74.    LOGO opens a window on the workbench screen as its command input and
  75. output window. You may enter and edit LOGO commands with these special
  76. keys.
  77.  
  78.    Backspace            Delete character to the left of the cursor.
  79.    Cursor Right         Move cursor right one space.
  80.    Cursor Left          Move cursor left one space.
  81.    Cursor Up            Move backward through the command history.
  82.    Cursor Down          Move forward through the command history.
  83.    Control-G            Stop program, return to top level.
  84.    Control-K            Delete from cursor to end of line.
  85.    Control-U            Delete from cursor to start of line.
  86.    Control-X            Delete the line.
  87.    Delete               Delete character under the cursor.
  88.    Return               Enter list or instructions.
  89.    Shift Cursor Right   Move cursor to end of line.
  90.    Shift Cursor Left    Move cursor to start of line.
  91.  
  92.    The "? " prompt means LOGO is waiting for a command. If the command
  93. line contains an open list (an open bracket " [ " without a closing
  94. bracket " ] ") you will see the "1 > " prompt allowing you to continue the
  95. list on another line.
  96.  
  97.  
  98. PROGRAMMING             * * * * * * * * * * * * * * * * * * * * * *
  99.  
  100.    In the Power LOGO programming environment, everything is either a word
  101. or a list. Words can be any sequence of characters. Words are separated
  102. from each other by blank spaces, to include a space (or a backslash) in a
  103. word it must be preceded by a backslash (\). Numbers are just a special
  104. type of word. Lists can be any sequence of objects, which may be ether
  105. words or lists. Lists are identified by enclosing them in brackets "[]".
  106.  
  107.    This-is-a-word!
  108.    [ This is a list! ]
  109.  
  110.    Words and lists may be either data or instructions. An instruction is a
  111. procedure name followed by any inputs the procedure may require. When LOGO
  112. tries to evaluate a word it may treat it in one of three ways, as a
  113. literal, as a variable, or as a procedure. Words preceded by a quote (")
  114. character (called quoted words) are literal and evaluate as the word
  115. itself. For words that happen to be numbers or pointers the quote is not
  116. needed. Words preceded by a colon (:) character (called dotted words) refer
  117. to the contents (binding) of a variable name. A word by itself (no dots or
  118. quote) is evaluated as a procedure (unless it is a number or pointer).
  119.  
  120.    ? print 123
  121.    123
  122.  
  123. Here "print" is a procedure, and the number "123" is its input. The "print"
  124. procedure simply prints its inputs on next line in the command window.
  125.  
  126.    ? print [ This is a list! ]
  127.    This is a list!
  128.  
  129. In this example the list (everything between the brackets) is the input to
  130. the "print" command. 
  131.  
  132.    ? print "This-is-a-word!
  133.    This-is-a-word!
  134.  
  135. In this example the quote (") identifies the input as a literal word.
  136.    The inputs to a procedure need not be literal, they may be the contents
  137. of a variable, or the output of another instruction. Instructions may be
  138. nested as inputs within other instructions.
  139.  
  140.    ? pr * 7 6
  141.    42
  142.  
  143. Here "*" is another procedure "6" and "7" are its inputs. "*" outputs the
  144. product of its inputs to pr ("pr" is just an abbreviation for "print")
  145. which prints it on the next line.
  146.  
  147.    ? make "x 100
  148.    ? pr :x
  149.    100
  150.  
  151. In the first line the "make" procedure assigns 100 as the contents of the
  152. variable "x". In the second line ":x" refers to the contents of "x".
  153.    Each procedure has some number of required inputs (zero or more), and
  154. some number of optional inputs (zero or more). To include optional inputs
  155. the entire instruction must be enclosed in parenthesis, if only the
  156. required inputs are used the parenthesis are not needed. Print requires one
  157. input but may have many.
  158.  
  159.    ? ( pr "PI "= 3.1415 )
  160.    PI = 3.1415
  161.  
  162. In this instruction "pr" has three inputs.
  163.  
  164.    ? ( pr [ And the answer is ] * 4 ( + 1 2 3 ) )
  165.    And the answer is 24
  166.  
  167. This entire line is one instruction where "pr" has two inputs, the first 
  168. is the list "[ And the answer is ]", the second is the instruction
  169. "* 4 ( + 1 2 3 )". This second instruction "*" has two inputs "4" and
  170. another instruction "( + 1 2 3 )".  
  171.    Primitives are the procedures that are bult-in to LOGO. You may define
  172. your own procedures and add them to LOGO. In Power LOGO a procedure is just
  173. a variable that contains a special type of list, and may be defined using
  174. the "make" primitive. The first item in a procedure definition list is the
  175. word procedure. The second item is a list of lists of names of the inputs
  176. and local variables used by the procedure (the names list). The rest of the
  177. items in the definition are the instructions executed by the procedure.
  178.  
  179.    ? make "hello [ procedure [ ] pr [ Hello World ! ] ]
  180.    ? hello
  181.    Hello World !
  182.  
  183. Because this example procedure uses no inputs or local variables the names
  184. list may be empty.
  185.    The first item of the variable names list is a list of required inputs.
  186. The second item is a list of optional inputs or a name to receive a list of
  187. optional inputs. The third item is a list of names of local variables.
  188. Local variables and unused optional inputs contain the empty list at the
  189. start.
  190.  
  191.    ? make "hello [
  192.    1 > procedure [ [ ] [ :n ] ]
  193.    1 > repeat if numberp :n [ :n ] [ 1 ] [
  194.    2 > pr [ Hello World ! ] ] ]
  195.  
  196.    ? hello
  197.    Hello World !
  198.  
  199.    ? ( hello 3 )
  200.    Hello World !
  201.    Hello World !
  202.    Hello World !
  203.  
  204.    ? ( hello 0 )
  205.  
  206. This example uses one optional input. See the example files for other forms
  207. of names lists.
  208.    Global, free, and local variables all work as they would in lisp. All
  209. variable names in a procedure names list are local within each call to that
  210. procedure. They are free variables to all procedures called from within
  211. that procedure or at a lower level.
  212.    A procedure that includes a call to itself is called a recursive
  213. procedure.
  214.  
  215.    ? make "factorial [
  216.    1 > procedure [ [ :f ] ]
  217.    1 > output if < 1 :f [ * :f factorial - :f 1 ] [ :f ] ]
  218.    ? factorial 5
  219.    120
  220.  
  221. This procedure uses recursion to compute the factorial of its input.
  222.    A procedure in which the recursive call is the last instruction is
  223. called tail recursive. Tail recursion is handeled differently by LOGO
  224. because the local variables need not be preserved. Two cases are
  225. reccognized as tail recursion, a recursive call as the input to an "output"
  226. command, or a recursive call followed by a "stop" command.
  227.  
  228.    ? make "count100 [
  229.    1 > procedure [ [ :x ] ]
  230.    1 > pr :x
  231.    1 > if < :x 100 [ output count100 + :x 1 ] [ output :x ] ]
  232.  
  233.    ? make "count [
  234.    1 > procedure [ [ :x ] ]
  235.    1 > pr :x
  236.    1 > count + :x 1
  237.    1 > stop ]
  238.  
  239. In the second example the "stop" command is never executed, but it is
  240. necessary for LOGO to recognize the call to "count" as tail recursion,
  241. without it "count" would run out of memory.
  242.  
  243.  
  244. FILES                   * * * * * * * * * * * * * * * * * * * * * *
  245.  
  246.    Primitives are provided to save and load the contents of variables
  247. (including procedures), read and write data, save and load IFF images, as
  248. well as get a filename through a file requester.
  249.    The "save" and "asave" primitives save the contents of variables to a
  250. file as "make" commands. The "load" command executes a text file as if it
  251. were typed at the command window except that comments are ignored (a
  252. comment is everything from a semicolon ";" to the end of the line).
  253.    To read or write a data file it must first be opened with "open" (a new
  254. file to be writen), or "openold" (an existing file to be read or appended).
  255. Each of these outputs a file-pointer (a BCPL pointer to an AmigaDOS file
  256. handle) which must later be closed using "close". The primitives for
  257. reading and writing files accept a file-pointer as input and work much like
  258. their command window counterparts.
  259.    The "saveimage", and "loadimage" primitives copy the contents of a
  260. window to or from an IFF ILBM file. For these to work the "ILBM.Library" by
  261. Software Dissidents must be in the LIBS: directory.
  262.    The "filerequest" primitive outputs an AmigaDOS file name selected with
  263. the PathMaster file selector by Justin V. McCormick. "filerequest" may be
  264. used as input to any procedure that requires a file name.
  265.  
  266.  
  267. GRAPHICS                * * * * * * * * * * * * * * * * * * * * * *
  268.  
  269.    Much of the Amiga graphics capability is available in Power LOGO.
  270. Primitives are provided to open custom intuition screens and windows, draw
  271. lines, patterned lines, text, flood fills, and copy regions.
  272.    Graphics are rendered into windows which must first be opened with
  273. "openwindow". The window graphics primitives require a window-pointer as an
  274. input. Coordinates within windows start with (0,0) in the upper left corner
  275. and count pixels to the right and down.
  276.  
  277.  
  278. TURTLES                 * * * * * * * * * * * * * * * * * * * * * *
  279.  
  280.    Turtles are graphics tools based on reletive movement. You may open many
  281. turtles, each is opened onto a window, has its own coordinate system, and
  282. has its own sense of location, distance, and direction, as well as its own
  283. foreground pen, background pen, draw mode, and line pattern.
  284.    By default the turtle commands control all active turtles, but may be
  285. directed to control specific turtles (active or not). Turtle operations
  286. output information about one specified turtle.
  287.  
  288.  
  289. DEMONS                  * * * * * * * * * * * * * * * * * * * * * *
  290.  
  291.    A demon may be thought of as a process separate from your main program,
  292. that keeps testing for a particular kind of event. When the event is
  293. detected the demon interupts the main program and runs a special procedure.
  294. When the procedure is complete the main program will resume.
  295.    There are four types of events that may trigger demons, menu selection,
  296. left mouse button, key stroke, and window close gadget. For each of these
  297. there is an event queue, when the event queue is not empty, the demon
  298. procedure will be run. The demon procedure must execute the appropriate get
  299. operation to remove the event from the queue, or the demon will run again
  300. and again.
  301.    For a simple example of demons in action load the file Mouse-Paint. For
  302. examples of menu demons see the files LOGO-Startup, and Mandelbrot.
  303.  
  304.  
  305. ERRORS                  * * * * * * * * * * * * * * * * * * * * * *
  306.  
  307.    Errors in syntax, or anything the interpreter does not recognize as
  308. valid LOGO instructions, should produce meaningful error messages.
  309.    Primitives that expect a pointer as input may cause LOGO to crash (guru)
  310. if passed a bad pointer.
  311.    The primitives "repitem", and "represt" destructively change an existing
  312. list and must be used carefully. If there is more than one reference to the
  313. list all references will be changed. They can also result in circular lists
  314. which appear infinite, and may cause LOGO to get stuck in a loop.
  315.  
  316.  
  317. RECOMMENDED READING     * * * * * * * * * * * * * * * * * * * * * *
  318.  
  319.    This document file describes the differences between Power LOGO and
  320. traditional versions of LOGO, these books will provide more background
  321. about LOGO. Two of these books, Computer Science Logo Style volume 1, and
  322. Visual Modeling with LOGO, include sections that may be helpful to
  323. beginners. There are many books available about programming in LOGO for
  324. beginners, the ones that I have read are real losers, and none are listed
  325. here. 
  326.  
  327. Computer Science Logo Style
  328.    Volume 1:   Intermediate Programming, 1985.
  329.    Volume 2:   Projects, Styles, amd Techniques, 1986.
  330.    Volume 3:   Advanced Topics, 1987.
  331.    Brian Harvey
  332.    MIT Press.
  333.       These are excellent books for anyone interested in programming, and
  334.    computer science.
  335.  
  336. Mindstorms:   Children, Computers, and Powerful Ideas.
  337.    Seymour Papert
  338.    Basic Books, 1980
  339.       This book is about education and how computers and programming may be
  340.    used by children, parents, and teachers. Required reading for parents,
  341.    and teachers interested in how children can make use of computers.
  342.  
  343. Turtle Geometry:   The Computer as a Medium for Exploring Mathematics.
  344.    Harold Abelson, and Andrea diSessa
  345.    MIT Press 1981
  346.       About turtles as a tool for the study of mathematics, geometry, and
  347.    topology.
  348.  
  349. Visual Modeling with LOGO:   A Structural Approach to Seeing.
  350.    James Clayson
  351.    MIT Press, 1988
  352.       About using LOGO and turtle graphics for exploring visual ideas and 
  353.    relationships.
  354.  
  355.  
  356. LOGO PRIMITIVES         * * * * * * * * * * * * * * * * * * * * * *
  357.  
  358. Types of inputs or outputs:
  359. angle                Number representing an angle.
  360. file-name            AmigaDOS file name.
  361. file-pointer         Pointer to a file obtained from open or openold.
  362. list                 Any list.
  363. name                 Variable name.
  364. name-list            List of variable names.
  365. number               A word that is a number.
  366. object               Any word or list.
  367. pointer              A word that is a pointer (machine address).
  368. position-list        List containing X Y coordinates.
  369. predicate            Something that evaluates as true or false.
  370. predicate-list       Run-list containing a predicate.
  371. property             Name of an object in a property list.
  372. run-list             List of LOGO instructions.
  373. screen-pointer       Pointer to a screen obtained from openscreen.
  374. turtle-pointer       Pointer to a turtle obtained from openturtle.
  375. window-pointer       Pointer to a window obtained from openwindow.
  376. word                 A word, a string of characters. 
  377. X                    Number representing a pixel coordinate.
  378. Y                    Number representing a pixel coordinate.
  379.  
  380.  
  381. +              number number (...)
  382. sum
  383.    Addition, output number + number + ... 
  384.  
  385. -              number number (...)
  386. difference
  387.    Subtraction, output number - number - ... 
  388.  
  389. *              number number (...)
  390. product
  391.    Multiplication, output number * number * ... 
  392.  
  393. /              number number (...)
  394. quotient
  395.    Division, output number / number / ... 
  396.  
  397. +-             number
  398. negate
  399.    Output -number, change sign of number.
  400.  
  401. >              number number (...)
  402.    Output true if first number is more than all others.
  403.  
  404. <              number number (...)
  405.    Output true if first number is less than all others.
  406.  
  407. >=             number number (...)
  408.    Output true if first number is more than or equal to all others.
  409.  
  410. <=             number number (...)
  411.    Output true if first number is less than or equal to all others.
  412.  
  413. =0             number (...)
  414.    Output true if all numbers are equal to zero.
  415.  
  416. <0             number (...)
  417.    Output true if all numbers are less than zero.
  418.  
  419. >0             number (...)
  420.    Output true if all numbers are more than zero.
  421.  
  422. abs            number
  423.    Output absolute value number.
  424.  
  425. alphap         word word
  426.    Output true if words are in alphabetical order.
  427.  
  428. and            predicate predicate (...)
  429.    Output true if all inputs are true.
  430.  
  431. asave          file-name name (...)
  432.                file-name name-list (...)
  433.    Append save. Add names and their bindings to end of file.
  434.  
  435. ascii          word
  436.    Output ASCII number of first character in word.
  437.  
  438. atan           number
  439.    Output angle of tangent. Where number is the tangent of angle. 
  440.  
  441. back           distance ( turtle-pointer ... )
  442. bk             distance ( turtle-pointer-list )
  443.    Move turtles backward distance.
  444.  
  445. buriedp        object
  446.    Output true if word is a buried name.
  447.  
  448. burylist
  449.    Output list of names that are buried.
  450.  
  451. bury           name (...)
  452.                name-list (...)
  453.    Hide and protect input names (from make, erase, namelist, etc.).
  454.  
  455. butfirst       object
  456. bf
  457.    Output object with first item removed.
  458.  
  459. butlast        object
  460. bl
  461.    Output object with last item removed.
  462.  
  463. catch          word run-list
  464.    Set trap for errors or throw.
  465.  
  466. char           number
  467.    Output word containing ASCII character. Where ( 1 <= number < 255 ).
  468.  
  469. clean          ( turtle-pointer ... )
  470.                ( turtle-pointer-list )
  471.    Blank turtles windows.
  472.  
  473. cleartext
  474.    Blank the command window.
  475.  
  476. closep
  477.    Output true if window-close queue is not empty.
  478.  
  479. close          file-pointer (...)
  480.    Close files.
  481.  
  482. closescreen    screen-pointer (...)
  483.    Close screens.
  484.  
  485. closeturtle    turtle-pointer (...)
  486.    Close turtles.
  487.  
  488. closewindow    window-pointer (...)
  489.    Close windows.
  490.  
  491. conditional    conditional-list
  492. cond
  493.    Execute run-list following first true predicate.
  494.          Conditional-list:
  495.                [ predicate-list run-list ... ]
  496.  
  497. copyrect       window-pointer X Y window-pointer X Y width height
  498.    Copy a region from window to window.
  499.  
  500. cos            angle
  501.    Output cosine of angle.
  502.  
  503. count          object
  504.    Output number of items in object.
  505.  
  506. cursor
  507.    Output position-list of command window text cursor.
  508.  
  509. degrees
  510.    Interpret angles as degrees.
  511.  
  512. doscommand     AmigaDOS-command-line-list
  513.    Run list as AmigaDOS command (as if typed at the CLI).
  514.  
  515. dot            ( turtle-pointer ... )
  516.                ( turtle-pointer-list )
  517.    Write pixel at turtles position.
  518.  
  519. dowhile        run-list predicate-list
  520.    Execute run-list while predicate-list is true.
  521.  
  522. downp          turtle-pointer
  523.    Output true if turtles pen is down.
  524.  
  525. draw           window-pointer X Y
  526.    Draw from a windows graphics cursor position to position X Y.
  527.  
  528. emptyp         object
  529.    Output true if object is the empty list or word.
  530.  
  531. eqp            object object (...)
  532.    Output true if all inputs refer to the same object.
  533.  
  534. equalp         object object (...)
  535. =
  536.    Output true if objects are identical.
  537.  
  538. erase          name (...)
  539.                name-list (...)
  540.    Remove bindings of input names that are not buried. Or remove bindings
  541.    of all input names.
  542.  
  543. error
  544.    Output error info list.
  545.  
  546. exor           predicate predicate
  547.    Output true if one input is true and one is false.
  548.  
  549. filelist
  550.    Output list of pointers to all open files.
  551.  
  552. filerequest    ( word )
  553.    Output file path name selected from file requester. Input word is the
  554.    requester title. This is the PathMaster file selector by Justin V.
  555.    McCormick.
  556.  
  557. first          object
  558.    Output first item of object.
  559.  
  560. firstput       object object
  561. fput
  562.    Output object made by adding first input to beginning of second input.
  563.  
  564. floodol        window-pointer X Y
  565.    Flood fill to outline.
  566.  
  567. forward        distance ( turtle-pointer ... )
  568. fd             distance ( turtle-pointer-list )
  569.    Move turtle forward.
  570.  
  571. fprint         file-pointer object (...)
  572.    Print object to file.
  573.  
  574. fprintout      file-pointer name (...)
  575.                file-pointer name-list (...)
  576.    Print names and their bindings file.
  577.  
  578. frac           number
  579.    Output fractional portion of number.
  580.  
  581. freadlist      file-pointer
  582.    Output list read from file (or eof for End Of File).
  583.  
  584. fshow          file-pointer object (...)
  585.    Print object to file.
  586.  
  587. ftype          file-pointer object (...)
  588.    Print object to file.
  589.  
  590. getclose
  591.    Output next window-pointer in the window close event queue, wait if the
  592.    event queue is empty.
  593.  
  594. getmenu
  595.    Output list containing the window-pointer, menu number, item number, and
  596.    subitem number of the next item from the menu event queue, wait if the
  597.    menu event queue is empty.
  598.  
  599. getmouse
  600.    Output list containing the window-pointer, X position, and Y position
  601.    where the mouse was when the button was pressed, wait if the mouse
  602.    event queue is empty.
  603.  
  604. getprop        name property
  605. gprop
  606.    Output property of name.
  607.  
  608. heading        turtle-pointer
  609.    Output turtles heading.
  610.  
  611. home           ( turtle-pointer ... )
  612.                ( turtle-pointer-list )
  613.    Move turtle to position [ 0 0 ] set heading 0.
  614.  
  615. if             predicate run-list run-list
  616.    If predicate is true execute first run-list, if false execute second
  617.    run-list. Both run-lists are required, if one case is not used, use the 
  618.    empty list [ ].
  619.  
  620. int            number
  621.    Output integer portion of number.
  622.  
  623. intuition      number pointer ( ?... )
  624.    Modify screens, windows, and menus.
  625.                1 screen-pointer X Y
  626.       Move screen (screen-pointer = @0 for workbench screen).
  627.                2 window-pointer X Y
  628.       Move window (window-pointer = @0 for command window).
  629.                3 window-pointer menu item subitem
  630.       Off menu (window-pointer = @0 for command window).
  631.                4 window-pointer menu item subitem
  632.       On menu (window-pointer = @0 for command window).
  633.                5 screen-pointer
  634.       Screen to back (screen-pointer = @0 for workbench screen).
  635.                6 screen-pointer
  636.       Screen to front (screen-pointer = @0 for workbench screen).
  637.                7 screen-pointer number
  638.       Show screen title (number <> 0) hide title (number = 0).
  639.                8 window-pointer X Y
  640.       Size window (window-pointer = @0 for command window).
  641.                9 window-pointer MinWidth MinHeight MaxWidth MaxHeight
  642.       Set window limits (window-pointer = @0 for command window).
  643.                10 window-pointer
  644.       Window to back (window-pointer = @0 for command window).
  645.                11 window-pointer
  646.       Window to front (window-pointer = @0 for command window).
  647.  
  648. item           number object
  649.    Output numbered item from object.
  650.  
  651. items          number number object
  652.    Output numbered items from object.
  653.  
  654. keyp
  655.    Output true if character queue is not empty.
  656.  
  657. last           object
  658.    Output last item from object.
  659.  
  660. lastput        object object
  661. lput
  662.    Output object made by adding first input to end of second input.
  663.  
  664. left           angle ( turtle-pointer ... )
  665. lt             angle ( turtle-pointer-list )
  666.    Rotate turtle left.
  667.  
  668. linep
  669.    Output true if line queue is not empty.
  670.  
  671. listp          object
  672.    Output true if object is a list.
  673.  
  674. list           object object (...)
  675.    Output list of input objects.
  676.  
  677. load           file-name (...)
  678.    Load file, runs a text file as if it were typed at the keybord.
  679.  
  680. loadimage      window-pointer file-name
  681.    Load a window from an IFF ILBM file. Requires "ilbm.library" from
  682.    Dissidents Software. BUG: sometimes loads entire screen.
  683.  
  684. log            base number
  685.    Output logarithm of number.
  686.  
  687. make           name object
  688.    Bind object to name. Make is the LOGO assignment operator. 
  689.  
  690. memberp        object object
  691.    Output true if second object contains first object.
  692.  
  693. menup
  694.    Output true if menu queue is not empty.
  695.  
  696. mousep
  697.    Output true if mouse-button queue is not empty.
  698.  
  699. mouse          window-pointer
  700.    Output list containing the X position, Y position and button position of
  701.    the mouse reletive to the window.
  702.  
  703. move           window-pointer X Y
  704.    Move a windows graphics cursor to position X Y.
  705.  
  706. namelist
  707.    Output list of names in use.
  708.  
  709. namep          object
  710.    Output true if object is a name with a value.
  711.  
  712. new
  713.    Remove bindings of all names (erase), close all files, close all
  714.    turtles, close all windows, close all screens, clear all menus, clear
  715.    all demons, flush all input queues, return to top level.  
  716.  
  717. not            predicate
  718.    Output true if input is false output false if input is true.
  719.  
  720. numberp        object
  721.    Output true if object is a number.
  722.  
  723. open           file-name
  724.    Create or open file to be written, output file-pointer.
  725.  
  726. openold        file-name
  727.    Open existing file to be read or written, output file-pointer.
  728.  
  729. openscreen     view-modes ( screen-data )
  730.                screen-data-list
  731.    Open custom graphics screen, output screen-pointer.
  732.          Screen-data:
  733.                View Modes, sum of:
  734.                   1 = hires
  735.                   2 = lace
  736.                   4 = extra half brite
  737.                Depth, number of bitplanes ( 1 - 6 )
  738.                Title, text-list
  739.                Left Edge
  740.                Top Edge
  741.                Width
  742.                Height
  743.                Detial Pen
  744.                Block Pen
  745.          Default screen-data-list:  [ 0 2 [ ] 0 0 320 200 0 1 ]
  746.                if View Modes = hires then default Width = 640
  747.                if View Modes = lace then default Height = 400
  748.                if View Modes = extra half brite then default Depth = 6
  749.  
  750. openturtle     window-pointer ( turtle-data )
  751.                turtle-data-list
  752.    Open a turtle, output turtle-pointer.
  753.          turtle-data:
  754.                window-pointer
  755.                scale or magnification
  756.                aspect ratio, pixel width / height
  757.                X position of home
  758.                Y position of home
  759.                heading of home
  760.                sign, >= 0 clockwise, < 0 counterclockwise
  761.          Default:
  762.                scale:      lores    1.8
  763.                            hires    3.2
  764.                            This means it takes 200 steps to go from the
  765.                            left edge to the right edge of the full screen.
  766.                aspect:     lores          0.88
  767.                            hires          0.44
  768.                            lores lace     1.76
  769.                            hires lace     0.88
  770.                            This makes circles look round and squares look
  771.                            square.
  772.                home X Y:   The current center of the window.
  773.                heading:    0  Straight up.
  774.                sign:       0  Clockwise.
  775.  
  776. openwindow     screen-pointer ( window-data )
  777.                window-data-list
  778.    Open custom graphics window, output window-pointer.
  779.          Window-data:
  780.                screen-pointer, @0 for workbench screen.
  781.                Flags, sum of
  782.                   1 = drag gadget
  783.                   2 = depth gadget
  784.                   4 = close gadget
  785.                   8 = size gadget
  786.                   16 = give me zero zero
  787.                   32 = backdrop
  788.                   64 = borderless
  789.                   128 = activate
  790.                Title, text list
  791.                Left Edge
  792.                Top Edge
  793.                Width
  794.                Height
  795.                Detial Pen
  796.                Block Pen
  797.                Min Width
  798.                Min Height
  799.                Max Width
  800.                Max Height
  801.          Default window-data-list WorkBench screen:
  802.                [ @0 3 [ ] 0 0 320 200 0 1 30 30 640 400 ]
  803.          Default window for custom screen:
  804.                Backdrop borderless window to fit the screen.
  805.  
  806. or             predicate predicate (...)
  807.    Output true if any inputs are true.
  808.  
  809. output         object
  810. op
  811.    Exit procedure return object.
  812.  
  813. pd             ( turtle-pointer ... )
  814.                ( turtle-pointer-list )
  815.    Turtle pen down.
  816.  
  817. peek           bytes address
  818.    Output number at address. Address may be a number or a pointer.
  819.          bytes =  0     32 bit pointer
  820.                   1     8 bit unsigned number
  821.                  -1     8 bit signed number
  822.                   2     16 bit unsigned number
  823.                  -2     16 bit signed number
  824.                   4     32 bit unsigned number
  825.                  -4     32 bit signed number
  826.                   8     64 bit IEEE double number
  827.  
  828. pen            window-pointer ( number )
  829.    Output the windows pen number (window-pointer = @0 for command window).
  830.          number = 0     foreground pen (default)
  831.          number = 1     background pen
  832.          number = 2     area outline pen
  833.  
  834. poerror
  835.    Print out error message.
  836.  
  837. pointerp       object
  838.    Output true if object is a pointer.
  839.  
  840. poke           bytes address number (...)
  841.    Write number or pointer to address. Address may be a number or a
  842.    pointer.
  843.          bytes =  1     8 bit number
  844.                   2     16 bit number
  845.                   4     32 bit number or pointer
  846.                   8     64 bit IEEE double number
  847.  
  848. power          number number
  849.    Output first number to the power of second number.
  850.  
  851. precision      ( number )
  852.    Sets or outputs precision used by print, fprint, type, ftype, and text
  853.    when printing numbers.
  854.  
  855. primitivep     object
  856.    Output true if object is a primitive.
  857.  
  858. print          object (...)
  859. pr
  860.    Print object to command window.
  861.  
  862. printout       name (...)
  863. po             name-list (...)
  864.    Print names and their bindings to command window.
  865.  
  866. procedurep     object
  867.    Output true if object is a procedure.
  868.  
  869. psum           address number (...)
  870.    Output pointer sum of address and numbers. Address may be a number or a
  871.    pointer.
  872.  
  873. pu             ( turtle-pointer ... )
  874.                ( turtle-pointer-list )
  875.    Turtle pen up.
  876.  
  877. putprop        name property object
  878. pprop
  879.    Assign object to property of name.
  880.  
  881. quit
  882.    Exit LOGO return to WorkBench or CLI.
  883.  
  884. radians
  885.    Interpret angles as radians.
  886.  
  887. rand
  888.    Output random fraction from zero to less than one.
  889.  
  890. random         number
  891.    Output random integer from zero to less than number.
  892.  
  893. readchar
  894. rc
  895.    Output one character word typed at keybord. Reads characters from
  896.    windows other than the command window. Waits if character event queue
  897.    is empty.
  898.  
  899. readlist
  900. rl
  901.    Output line typed at keybord as a list. Reads lines from the command
  902.    window. Waits if line queue is empty.
  903.  
  904. readpixel      window-pointer X Y
  905.    Output pen number of pixel at position X Y.
  906.  
  907. rectfill       window-pointer X Y X Y
  908.    Fill rectangle from X Y to X Y.
  909.  
  910. recycle        ( number )
  911.    Without an input, recycles memory and frees any unused blocks.
  912.    With an input, just recycles memory.
  913.  
  914. remainder      number number
  915.    Output remainder after division.
  916.  
  917. remprop        name property
  918.    Remove property from name.
  919.  
  920. repeat         number run-list
  921.    Execute run-list number of times.
  922.  
  923. repitem        number list object
  924.    Replace numbered item of list with object. This is similar to "rplaca"
  925.    in Lisp. WARNING: repitem destructively changes an existing list and you
  926.    may obtain unexpected results if there is more than one reference to the
  927.    list.
  928.  
  929. represt        number list object
  930.    Replace rest of list after numbered item with object. This is similar to
  931.    "rplacd" in Lisp. WARNING: represt destructively changes an existing
  932.    list and you may obtain unexpected results if there is more than one
  933.    reference to the list.
  934.  
  935. restof         number object
  936.    Output rest of object following numbered item.
  937.  
  938. rgb            screen-pointer number
  939.    Output color list.
  940.  
  941. right          angle ( turtle-pointer ... )
  942. rt             angle ( turtle-pointer-list )
  943.    Rotate turtle right.
  944.  
  945. round          number
  946.    Output number rounded to nearest integer.
  947.  
  948. run            run-list
  949.    Execute run-list.
  950.  
  951. save           file-name name (...)
  952.                file-name name-list (...)
  953.    Save names and their bindings to file.
  954.  
  955. saveimage      window-pointer file-name
  956.    Save a window to an IFF ILBM file. Requires "ilbm.library" from
  957.    Dissidents Software. BUG: sometimes saves entire screen.
  958.  
  959. screenlist
  960.    Output list of pointers to all open screens.
  961.  
  962. seconds
  963.    Output system time in seconds.
  964.  
  965. seedrand       ( number )
  966.    Re-seed random number generator.
  967.  
  968. seekend        file-pointer
  969.    Move to end of file.
  970.  
  971. seekstart      file-pointer
  972.    Move to start of file.
  973.  
  974. sentence       object object (...)
  975. se
  976.    Output list of input objects. Lists in the input to sentence will have
  977.    their outer brackets removed.
  978.  
  979. setafpt        window-pointer pattern-list
  980.    Set area fill pattern. Pattern-list is a list of up to 16 words, each 16
  981.    characters long where "x" is an on pixel, any other character is an off
  982.    pixel.
  983.  
  984. setcursor      position-list
  985.    Set command window text cursor position.
  986.  
  987. setdrmode      window-pointer mode
  988.    Set a windows draw mode (window-pointer = @0 for command window).
  989.          Mode, sum of:
  990.                   0 = JAM1
  991.                   1 = JAM2
  992.                   2 = COMPLEMENT
  993.                   4 = INVERSVID
  994.  
  995. setfont        window-pointer font-name font-height
  996.    Set a windows text font (window-pointer = @0 for command window).
  997.  
  998. seth           angle ( turtle-pointer ... )
  999.                angle ( turtle-pointer-list )
  1000.    Set turtles heading.
  1001.  
  1002. setlinept      window-pointer pattern
  1003.    Set a windows line pattern. Where pattern is a word 16 characters long
  1004.    where "x" is an on pixel, any other character is an off pixel.
  1005.  
  1006. setmenu        window-pointer menu-list
  1007.    Attach a menu strip to the window (window-pointer = @0 for command
  1008.    window).
  1009.          menu-list:     (where "K" is a keybord short cut)
  1010.                [ menu-name-1 [ item-1-1 K ]
  1011.                              [ item-1-2 [ subitem-1-2-1 K ]
  1012.                                         [ subitem-1-2-2 K ] ]
  1013.                  menu-name-2 [ item-2-1 ]
  1014.                              [ item-2-2 ] ]
  1015.  
  1016. setpen         window-pointer pen ( number )
  1017.    Set a windows pen number (window-pointer = @0 for command window).
  1018.          number = 0     foreground pen (default)
  1019.          number = 1     background pen
  1020.          number = 2     area outline pen
  1021.  
  1022. setrgb         screen-pointer number [ r g b ]
  1023.    Set a screens color register number to [ r g b ].
  1024.  
  1025. setstyle       window-pointer style
  1026.    Set the text render style (window-pointer = @0 for command window).
  1027.          Style, sum of:
  1028.                   0 = plain
  1029.                   1 = underlined
  1030.                   2 = bold
  1031.                   4 = italic
  1032.  
  1033. settdm         mode ( turtle-pointer ... )
  1034.                mode ( turtle-pointer-list )
  1035.    Set turtles draw mode (window-pointer = @0 for command window).
  1036.          Mode, sum of:
  1037.                   0 = JAM1
  1038.                   1 = JAM2
  1039.                   2 = COMPLEMENT
  1040.                   4 = INVERSVID
  1041.  
  1042. settlp         pattern ( turtle-pointer ... )
  1043.                pattern ( turtle-pointer-list )
  1044.    Set turtle line pattern. Where pattern is a word 16 characters long
  1045.    where "x" is an on pixel, any other character is an off pixel.
  1046.  
  1047. settpn         pen number ( turtle-pointer ... )
  1048.                pen number ( turtle-pointer-list )
  1049.    Set turtles pen number.
  1050.          number = 0     foreground pen
  1051.          number = 1     background pen
  1052.  
  1053. settpos        position-list ( turtle-pointer ... )
  1054.                position-list ( turtle-pointer-list )
  1055.    Set turtles position.
  1056.  
  1057. show           object (...)
  1058.    Print object to command window.
  1059.  
  1060. sin            angle
  1061.    Output sine of angle.
  1062.  
  1063. sleep
  1064.    Wait for an event (mouse, menu, keyboard, or window close).
  1065.                                         
  1066. sqrt           number
  1067.    Output square root of number.
  1068.  
  1069. stick
  1070.    Output list containing the X position, Y position and button position of
  1071.    a joystick in port number two.
  1072.  
  1073. stop
  1074.    Exit procedure.
  1075.  
  1076. system         number ( ? )
  1077.    Control memory, libraries, and demons. 
  1078.                1
  1079.       Output the amount of memory LOGO tries to hold in reserve.
  1080.                2 bytes
  1081.       Set the amount of memory LOGO tries to hold in reserve.
  1082.                3 bytes
  1083.       Allocate memory, output pointer to block.
  1084.                4 bytes
  1085.       Allocate chip memory, output pointer to block.
  1086.                5 pointer
  1087.       Free memory.
  1088.                6
  1089.       Output list of pointers to allocated memory blocks.
  1090.                7
  1091.       Open Diskfont library.
  1092.                8
  1093.       Close Diskfont library.
  1094.                9
  1095.       Open ILBM library.
  1096.                10
  1097.       Close ILBM library.
  1098.                11
  1099.       Enable demons.
  1100.                12
  1101.       Disable demons.
  1102.  
  1103. tan            angle
  1104.    Output tangent of angle.
  1105.  
  1106. tell           turtle-pointer (...)
  1107.                turtle-pointer-list
  1108.    Make these the active turtles.
  1109.  
  1110. text           window-pointer object
  1111.    Print text to a window.
  1112.  
  1113. thing          name
  1114.    Output object bound to name (contents of variable).
  1115.  
  1116. throw          word
  1117.    Escape to matching catch.
  1118.  
  1119. toplevel
  1120.    Exit program return to top level.
  1121.  
  1122. toward         position-list turtle-pointer
  1123.    Output heading to point turtle toward position.
  1124.  
  1125. tpen           turtle-pointer ( number )
  1126.    Output the turtles pen number.
  1127.          number = 0     foreground pen
  1128.          number = 1     background pen
  1129.  
  1130. tpos           turtle-pointer
  1131.    Output the turtles position-list.
  1132.  
  1133. turtlelist
  1134.    Output list of all open turtles.
  1135.  
  1136. turtleoff      ( turtle-pointer ... )
  1137.                ( turtle-pointer-list )
  1138.    Deactivate turtles.
  1139.  
  1140. turtleon       ( turtle-pointer ... )
  1141.                ( turtle-pointer-list )
  1142.    Activate turtles.
  1143.  
  1144. twpos          turtle-pointer
  1145.    Output Turtles position-list in window coordinates.
  1146.  
  1147. type           object (...)
  1148.    Print object to command window.
  1149.  
  1150. unbury         name (...)
  1151.                name-list (...)
  1152.    Make input names accessable.
  1153.  
  1154. wait           number
  1155.    Pause for number of seconds.
  1156.  
  1157. whenchar       run-list
  1158.    Set demon to run when key stroke is detected. Run-list must execute a
  1159.    "readchar" to clear the character queue.
  1160.  
  1161. whenclose      run-list
  1162.    Set demon to run when window-close is detected. Run-list must execute a
  1163.    "getclose" to clear the window-close queue.
  1164.  
  1165. whenmenu       run-list
  1166.    Set demon to run when menu item is selected. Run-list must execute a
  1167.    "getmenu" to clear the menu-selection queue.
  1168.  
  1169. whenmouse      run-list
  1170.    Set demon to run when mouse-button is pressed. Run-list must execute a
  1171.    "getmouse" to clear the mouse-button queue.
  1172.  
  1173. while          predicate-list run-list
  1174.    While predicate-list is true, execute run-list.
  1175.  
  1176. window         ( turtle-pointer ... )
  1177.                ( turtle-pointer-list )
  1178.    Allow turtle to cross edge of window.
  1179.  
  1180. windowlist
  1181.    Output list of pointers to all open windows.
  1182.  
  1183. word           word word (...)
  1184.    Output word made up of input words.
  1185.  
  1186. wordp          object
  1187.    Output true if object is a word.
  1188.  
  1189. wrap           ( turtle-pointer ... )
  1190.                ( turtle-pointer-list )
  1191.    Make turtle wrap around at edge of window.
  1192.  
  1193. writepixel     window-pointer X Y
  1194.    Set pixel X Y to the pen color.
  1195.  
  1196. wtpos          turtle-pointer
  1197.    Output windows position-list in turtle coordinates.
  1198.  
  1199.  
  1200. PLEASE HELP ME          * * * * * * * * * * * * * * * * * * * * * *
  1201.  
  1202.    Help me to improve this version of LOGO. Please contact me with any
  1203. comments or bug reports.
  1204.  
  1205.    Gary Teachout 
  1206.    10532  66 Place, W
  1207.    Everett, WA  98204
  1208.    USA
  1209.  
  1210.