BERKELEY LOGO 6.1 Berkeley Logo User Manual
Total Page:16
File Type:pdf, Size:1020Kb
BERKELEY LOGO 6.1 Berkeley Logo User Manual Brian Harvey i Short Contents 1 Introduction :::::::::::::::::::::::::::::::::::::::::: 1 2 Data Structure Primitives::::::::::::::::::::::::::::::: 9 3 Communication :::::::::::::::::::::::::::::::::::::: 19 4 Arithmetic :::::::::::::::::::::::::::::::::::::::::: 29 5 Logical Operations ::::::::::::::::::::::::::::::::::: 35 6 Graphics:::::::::::::::::::::::::::::::::::::::::::: 37 7 Workspace Management ::::::::::::::::::::::::::::::: 49 8 Control Structures :::::::::::::::::::::::::::::::::::: 67 9 Macros ::::::::::::::::::::::::::::::::::::::::::::: 83 10 Error Processing ::::::::::::::::::::::::::::::::::::: 87 11 Special Variables ::::::::::::::::::::::::::::::::::::: 89 12 Internationalization ::::::::::::::::::::::::::::::::::: 93 INDEX :::::::::::::::::::::::::::::::::::::::::::::::: 97 iii Table of Contents 1 Introduction ::::::::::::::::::::::::::::::::::::: 1 1.1 Overview ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 1 1.2 Getter/Setter Variable Syntax :::::::::::::::::::::::::::::::::: 2 1.3 Entering and Leaving Logo ::::::::::::::::::::::::::::::::::::: 5 1.4 Tokenization:::::::::::::::::::::::::::::::::::::::::::::::::::: 6 2 Data Structure Primitives :::::::::::::::::::::: 9 2.1 Constructors ::::::::::::::::::::::::::::::::::::::::::::::::::: 9 word ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 9 list ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 9 sentence :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 9 fput :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 9 lput :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 9 array ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 9 mdarray ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 10 listtoarray ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 10 arraytolist ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 10 combine ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 10 reverse :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 10 gensym:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 10 2.2 Data Selectors ::::::::::::::::::::::::::::::::::::::::::::::::: 10 first ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 10 firsts :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 11 last ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 11 butfirst :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 11 butfirsts ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 11 butlast :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 12 item::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 12 mditem ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 12 pick ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 12 remove :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 12 remdup ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 12 quoted :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 12 2.3 Data Mutators :::::::::::::::::::::::::::::::::::::::::::::::: 12 setitem :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 12 mdsetitem ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 13 .setfirst :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 13 .setbf:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 13 .setitem ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 13 push :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 13 pop ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 13 queue ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 14 dequeue ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 14 iv BERKELEY LOGO 6.1 2.4 Predicates ::::::::::::::::::::::::::::::::::::::::::::::::::::: 14 wordp ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 14 listp ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 14 arrayp::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 14 emptyp:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 14 equalp::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 14 notequalp ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 15 beforep :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 15 .eq :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 15 memberp :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 15 substringp ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 16 numberp :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 16 vbarredp :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 16 2.5 Queries:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 16 count:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 16 ascii ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 16 rawascii ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 16 char ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 17 member ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 17 lowercase :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 17 uppercase ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 17 standout :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 17 parse :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 18 runparse :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 18 3 Communication :::::::::::::::::::::::::::::::: 19 3.1 Transmitters :::::::::::::::::::::::::::::::::::::::::::::::::: 19 print :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 19 type::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 19 show :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 20 3.2 Receivers :::::::::::::::::::::::::::::::::::::::::::::::::::::: 20 readlist :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 20 readword :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 20 readrawline:::::::::::::::::::::::::::::::::::::::::::::::::::::: 20 readchar::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 21 readchars:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 21 shell::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 21 3.3 File Access :::::::::::::::::::::::::::::::::::::::::::::::::::: 22 setprefix::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 22 prefix ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 22 openread :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 22 openwrite ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 22 openappend ::::::::::::::::::::::::::::::::::::::::::::::::::::: 23 openupdate:::::::::::::::::::::::::::::::::::::::::::::::::::::: 23 close :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 23 allopen :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 23 closeall :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 23 erasefile ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 23 v dribble :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 24 nodribble:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 24 setread :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 24 setwrite ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 24 reader ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 25 writer ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 25 setreadpos::::::::::::::::::::::::::::::::::::::::::::::::::::::: 25 setwritepos :::::::::::::::::::::::::::::::::::::::::::::::::::::: 25 readpos ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 25 writepos::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 25 eofp ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 25 filep ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 26 3.4 Terminal Access ::::::::::::::::::::::::::::::::::::::::::::::: 26 keyp :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 26 cleartext :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 26 setcursor :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 26 cursor ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 26 setmargins :::::::::::::::::::::::::::::::::::::::::::::::::::::: 26 settextcolor:::::::::::::::::::::::::::::::::::::::::::::::::::::: 27 increasefont ::::::::::::::::::::::::::::::::::::::::::::::::::::: 27 settextsize ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 27 textsize:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 27 setfont :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 28 font ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 28 4 Arithmetic :::::::::::::::::::::::::::::::::::::: 29 4.1 Numeric Operations ::::::::::::::::::::::::::::::::::::::::::: 29 sum ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 29 difference:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 29 minus ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 29 product ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 29 quotient ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 29 remainder ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 30 modulo:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 30 int :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 30 round ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 30 sqrt ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 30 power :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::