A Guide to LSRHS Logo Release 3, for people who knew Release 1 LSRHS Logo has been changed to be much faster and more robust. It also is different in its user interface from the previous version, so that it more closely resembles Apple Logo. Here are the most important changes: 1. The line number editor no longer exists. There are two ways to define a procedure. The "to" command lets you type in the procedure, somewhat as before, but without line numbers and with no correction facility. The "edit" command runs edt so you can use the power of display editing. You can use "edit" even if the procedure did not previously exist. 2. Most Logo procedures evaluate their inputs: if you want to use a particular word as an input you must quote it. In old LSRHS Logo there were several exceptions: edit, erase, show, and describe all took as inputs an unquoted name of a procedure. These procedures are no longer exceptional. You must say edit "foo to edit the procedure foo, for example. You can also give edit, erase, or show a list of procedures as inputs, which will apply them to all of the procedures you name at once. It is particularly convenient sometimes to be able to edit two procedures at the same time. Note: The "to" command is still exceptional in that it doesn't evaluate its inputs. 3. The "edit" command with no input at all will re-edit whatever you edited last time. It remembers the buffer file as long as you stay in Logo. 4. If you are editing with "edit" and change your mind, so you don't want to redefine any procedures, leave edt with ESC ^Z instead of just ^Z. This will tell Logo not to change the procedure definitions. (This is only true at LSRHS, or wherever the text editor cooperates by setting a nonzero exit status.) 5. You can put comments on a Logo instruction line by starting the comment with an exclamation point: print "foo ! This is a comment. The exclamation point must not be part of a word or list, which is why there is a space before it in the example. 6. The "if" command syntax is completely different. It, too, used to be an exception to the rule about quoting inputs. It now takes either two or three inputs. The first is a predicate, as before. The second and third are lists of instructions, as in the repeat command: if 2=3 [print "yes] [print "no] The second input is executed if the predicat is true, the (optional) third if it's false. If the things in the second and third inputs are expressions rather than complete instructions, "if" can be used as an operation: print if 2=3 ["yes] ["no] The third input is required in that case. The difference in "if" is likely to be the biggest headache to people used to the old way. Your Logo procedures must be changed like this: old: if :num=0 stop new: if :num=0 [stop] 7. Many abbreviations are removed or changed: sentence s -> se print p -> pr goodbye g -> bye gone completely: ei, gp, lp, rq, pro, q, w, eq, ep, np, wp, c, th, na, lo, m, sp, zp, ti, d, t, ut. 8. Some synonyms are added to be like Apple Logo: full fullscreen split splitscreen text textscreen atan arctan either or both and The old names still work also. 9. The procedures repeat, nth (synonym item), and memberp, which were library procedures written in Logo before, are now primitives, so they're faster. NOTE: The order of the inputs to repeat has been reversed: repeat 4 [fd 40; rt 90] 10. Lots of bugs have been fixed. In particular, several limitations on repeat (and run) have been removed: You can have a repeat within a repeat, multiple instructions within a repeat, etc. New in Release 3 (compared to Release 2): 11. There is now a pause facility, which allows you to enter interactive commands in the context of a running procedure, to examine or modify local variables. This happens, among other things, when you type the system interrupt character (^C at LSRHS). Typing the quit character (^G at LSRHS) does what it always did, namely stop all procedures. 12. Turtle commands like forward do an automatic turtle "display if you don't already have a turtle. 13. New primitives: (Already in release 2): readlist (abbrev rl)-- Like request but doesn't print a "?" prompt. int-- Takes one numeric input, gives integer part (truncates). round-- Takes one numeric input, gives nearest integer (rounds). ascii-- Takes a single-character word, gives the numeric code for that char. char-- Takes a number, gives the corresponding character. oflush-- Command, no inputs. Use this to make stuff you've printed actually get printed right away. Normally, what you print is buffered until you have to type in something. pprop, gprop, remprop, plist, pps-- Property lists. Named properties can be associated with a word. Examples: pprop "bh "firstname "Brian pprop "bh "lastname "Harvey print gprop "bh "firstname -> Brian fprint plist "bh -> [firstname Brian lastname Harvey] pps -> bh's firstname is Brian bh's lastname is Harvey remprop "bh "lastname test, iftrue (abbrev ift), iffalse (abbrev iff)-- An alternate form of "if": test 2=3 iftrue [print "foo] iffalse [print "baz] These are most useful if you have several instructions all conditional on the same test. You can use any number of iftrue and iffalse commands, in any order. The result of "test" is remembered locally for each procedure. New in Release 3 (compared to Release 2): setscrunch, scrunch-- Set and get the aspect ratio, a number by which the vertical component of turtle motion is multiplied. Make squares really square. wipeclean (clean)-- Like clearscreen, but don't move the turtle. penreverse (px)-- A pen mode in which each dot in the turtle's path is turned on if it was ff and vice versa. penmode-- Outputs one of the words penup, pendown, penerase, or penreverse. shownp-- Outputs true if the turtle is visible. towardsxy-- Outputs the heading to which to turn the turtle in order for it to face the point specified by the two inputs. repcount-- Outputs how many times through the repeat we've done. Try repeat 10 [print repcount] repeat 50 [fd 20+2*repcount; rt 90] pause-- In a procedure, pause. Accept commands from the terminal, but with local variables available. continue (co)-- Continue the procedure from which Logo paused. errpause-- From now on, pause instead of stopping if an error happens inside a procedure. errquit-- From now on, quit on errors. setipause-- From now on, interrupt (^C) pauses and quit (^G) stops. setqpause-- From now on, quit (^G) pauses and interrupt (^C) stops.