home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / logo / part02 / olddiff < prev    next >
Encoding:
Text File  |  1987-06-23  |  6.5 KB  |  195 lines

  1.  
  2. A Guide to LSRHS Logo Release 3, for people who knew Release 1
  3.  
  4. LSRHS Logo has been changed to be much faster and more robust.  It also
  5. is different in its user interface from the previous version, so that it
  6. more closely resembles Apple Logo.  Here are the most important changes:
  7.  
  8. 1.  The line number editor no longer exists.  There are two ways to define
  9. a procedure.  The "to" command lets you type in the procedure, somewhat as
  10. before, but without line numbers and with no correction facility.  The
  11. "edit" command runs edt so you can use the power of display editing.  You
  12. can use "edit" even if the procedure did not previously exist.
  13.  
  14. 2.  Most Logo procedures evaluate their inputs: if you want to use a
  15. particular word as an input you must quote it.  In old LSRHS Logo there
  16. were several exceptions: edit, erase, show, and describe all took as inputs
  17. an unquoted name of a procedure.  These procedures are no longer exceptional.
  18. You must say
  19.     edit "foo
  20. to edit the procedure foo, for example.  You can also give edit, erase, or
  21. show a list of procedures as inputs, which will apply them to all of the
  22. procedures you name at once.  It is particularly convenient sometimes to be
  23. able to edit two procedures at the same time.
  24.  
  25. Note: The "to" command is still exceptional in that it doesn't evaluate
  26. its inputs.
  27.  
  28. 3.  The "edit" command with no input at all will re-edit whatever you edited
  29. last time.  It remembers the buffer file as long as you stay in Logo.
  30.  
  31. 4.  If you are editing with "edit" and change your mind, so you don't want to
  32. redefine any procedures, leave edt with ESC ^Z instead of just ^Z.  This will
  33. tell Logo not to change the procedure definitions.  (This is only true at
  34. LSRHS, or wherever the text editor cooperates by setting a nonzero exit
  35. status.)
  36.  
  37. 5.  You can put comments on a Logo instruction line by starting the comment
  38. with an exclamation point:
  39.     print "foo ! This is a comment.
  40. The exclamation point must not be part of a word or list, which is why there
  41. is a space before it in the example.
  42.  
  43. 6.  The "if" command syntax is completely different.  It, too, used to be an
  44. exception to the rule about quoting inputs.  It now takes either two or three
  45. inputs.  The first is a predicate, as before.  The second and third are lists
  46. of instructions, as in the repeat command:
  47.     if 2=3 [print "yes] [print "no]
  48. The second input is executed if the predicat is true, the (optional) third
  49. if it's false.  If the things in the second and third inputs are expressions
  50. rather than complete instructions, "if" can be used as an operation:
  51.     print if 2=3 ["yes] ["no]
  52. The third input is required in that case.
  53.  
  54. The difference in "if" is likely to be the biggest headache to people used to
  55. the old way.  Your Logo procedures must be changed like this:
  56.     old:    if :num=0 stop
  57.     new:    if :num=0 [stop]
  58.  
  59. 7.  Many abbreviations are removed or changed:
  60.     sentence    s -> se
  61.     print        p -> pr
  62.     goodbye        g -> bye
  63.  
  64.     gone completely: ei, gp, lp, rq, pro, q, w, eq, ep, np, wp,
  65.     c, th, na, lo, m, sp, zp, ti, d, t, ut.
  66.  
  67. 8.  Some synonyms are added to be like Apple Logo:
  68.     full        fullscreen
  69.     split        splitscreen
  70.     text        textscreen
  71.     atan        arctan
  72.     either        or
  73.     both        and
  74. The old names still work also.
  75.  
  76. 9.  The procedures repeat, nth (synonym item), and memberp, which were
  77. library procedures written in Logo before, are now primitives, so they're
  78. faster.  NOTE: The order of the inputs to repeat has been reversed:
  79.     repeat 4 [fd 40; rt 90]
  80.  
  81. 10.  Lots of bugs have been fixed.  In particular, several limitations on
  82. repeat (and run) have been removed: You can have a repeat within a repeat,
  83. multiple instructions within a repeat, etc.
  84.  
  85. New in Release 3 (compared to Release 2):
  86.  
  87. 11.  There is now a pause facility, which allows you to enter interactive
  88. commands in the context of a running procedure, to examine or modify local
  89. variables.  This happens, among other things, when you type the system
  90. interrupt character (^C at LSRHS).  Typing the quit character (^G at LSRHS)
  91. does what it always did, namely stop all procedures.
  92.  
  93. 12.  Turtle commands like forward do an automatic turtle "display if
  94. you don't already have a turtle.
  95.  
  96. 13.  New primitives:
  97.  
  98. (Already in release 2):
  99.  
  100. readlist (abbrev rl)--
  101.     Like request but doesn't print a "?" prompt.
  102.  
  103. int--
  104.     Takes one numeric input, gives integer part (truncates).
  105.  
  106. round--
  107.     Takes one numeric input, gives nearest integer (rounds).
  108.  
  109. ascii--
  110.     Takes a single-character word, gives the numeric code for that char.
  111.  
  112. char--
  113.     Takes a number, gives the corresponding character.
  114.  
  115. oflush--
  116.     Command, no inputs.  Use this to make stuff you've printed actually
  117.     get printed right away.  Normally, what you print is buffered until
  118.     you have to type in something.
  119.  
  120. pprop, gprop, remprop, plist, pps--
  121.     Property lists.  Named properties can be associated with a word.
  122.     Examples:
  123.  
  124.         pprop "bh "firstname "Brian
  125.         pprop "bh "lastname "Harvey
  126.         print gprop "bh "firstname
  127.             -> Brian
  128.         fprint plist "bh
  129.             -> [firstname Brian lastname Harvey]
  130.         pps
  131.             -> bh's firstname is Brian
  132.                bh's lastname is Harvey
  133.         remprop "bh "lastname
  134.  
  135. test, iftrue (abbrev ift), iffalse (abbrev iff)--
  136.     An alternate form of "if":
  137.  
  138.         test 2=3
  139.         iftrue [print "foo]
  140.         iffalse [print "baz]
  141.  
  142.     These are most useful if you have several instructions all conditional
  143.     on the same test.  You can use any number of iftrue and iffalse
  144.     commands, in any order.  The result of "test" is remembered locally
  145.     for each procedure.
  146.  
  147. New in Release 3 (compared to Release 2):
  148.  
  149. setscrunch, scrunch--
  150.     Set and get the aspect ratio, a number by which the vertical
  151.     component of turtle motion is multiplied.  Make squares really square.
  152.  
  153. wipeclean (clean)--
  154.     Like clearscreen, but don't move the turtle.
  155.  
  156. penreverse (px)--
  157.     A pen mode in which each dot in the turtle's path is turned on if
  158.     it was ff and vice versa.
  159.  
  160. penmode--
  161.     Outputs one of the words penup, pendown, penerase, or penreverse.
  162.  
  163. shownp--
  164.     Outputs true if the turtle is visible.
  165.  
  166. towardsxy--
  167.     Outputs the heading to which to turn the turtle in order for it
  168.     to face the point specified by the two inputs.
  169.  
  170. repcount--
  171.     Outputs how many times through the repeat we've done.  Try
  172.         repeat 10 [print repcount]
  173.         repeat 50 [fd 20+2*repcount; rt 90]
  174.  
  175. pause--
  176.     In a procedure, pause.  Accept commands from the terminal, but with
  177.     local variables available.
  178.  
  179. continue (co)--
  180.     Continue the procedure from which Logo paused.
  181.  
  182. errpause--
  183.     From now on, pause instead of stopping if an error happens inside
  184.     a procedure.
  185.  
  186. errquit--
  187.     From now on, quit on errors.
  188.  
  189. setipause--
  190.     From now on, interrupt (^C) pauses and quit (^G) stops.
  191.  
  192. setqpause--
  193.     From now on, quit (^G) pauses and interrupt (^C) stops.
  194.  
  195.