1
0
mirror of synced 2026-01-21 18:34:48 +00:00
2021-01-22 22:41:07 +00:00

104 lines
410 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Medley-Primer-OnePage</title><style type="text/css"> * {margin:0; padding:0; text-indent:0; }
.s1 { color: black; font-family:"Times New Roman", serif; font-style: italic; font-weight: normal; text-decoration: none; font-size: 24pt; }
h4 { color: black; font-family:Arial, sans-serif; font-style: normal; font-weight: bold; text-decoration: none; font-size: 10pt; }
.p, p { color: black; font-family:"Times New Roman", serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; margin:0pt; }
.s2 { color: black; font-family:Symbol, serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
h1 { color: black; font-family:Arial, sans-serif; font-style: normal; font-weight: bold; text-decoration: none; font-size: 18pt; }
.s3 { color: black; font-family:"Courier New", monospace; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
.s4 { color: black; font-family:"Times New Roman", serif; font-style: italic; font-weight: normal; text-decoration: none; font-size: 10pt; }
.s5 { color: black; font-family:Arial, sans-serif; font-style: normal; font-weight: bold; text-decoration: none; font-size: 14pt; }
.s6 { color: black; font-family:Arial, sans-serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
.s7 { color: black; font-family:Arial, sans-serif; font-style: normal; font-weight: normal; text-decoration: underline; font-size: 10pt; }
.s8 { color: black; font-family:Arial, sans-serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; vertical-align: -2pt; }
h2 { color: black; font-family:Arial, sans-serif; font-style: normal; font-weight: bold; text-decoration: underline; font-size: 14pt; }
.s9 { color: black; font-family:"Courier New", monospace; font-style: normal; font-weight: bold; text-decoration: none; font-size: 10pt; }
.s10 { color: black; font-family:"Times New Roman", serif; font-style: normal; font-weight: bold; text-decoration: none; font-size: 10pt; }
.s11 { color: black; font-family:"Courier New", monospace; font-style: normal; font-weight: normal; text-decoration: underline; font-size: 10pt; }
.s12 { color: black; font-style: normal; font-weight: normal; text-decoration: none; }
h3 { color: black; font-family:Arial, sans-serif; font-style: normal; font-weight: bold; text-decoration: none; font-size: 12pt; }
.s13 { color: black; font-family:"Courier New", monospace; font-style: normal; font-weight: normal; text-decoration: none; font-size: 12pt; }
.s14 { color: black; font-family:"Courier New", monospace; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; vertical-align: 2pt; }
.s15 { color: black; font-family:"Times New Roman", serif; font-style: italic; font-weight: bold; text-decoration: none; font-size: 10pt; }
li {display: block; }
#l1 {padding-left: 0pt;counter-reset: c1 1; }
#l1> li>*:first-child:before {counter-increment: c1; content: counter(c1, decimal)". "; color: black; font-family:Arial, sans-serif; font-style: normal; font-weight: bold; text-decoration: none; font-size: 18pt; }
#l1> li:first-child>*:first-child:before {counter-increment: c1 0; }
li {display: block; }
#l2 {padding-left: 0pt; }
#l2> li>*:first-child:before {content: "• "; color: black; font-family:"Times New Roman", serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
li {display: block; }
#l3 {padding-left: 0pt;counter-reset: e1 1; }
#l3> li>*:first-child:before {counter-increment: e1; content: counter(e1, decimal)". "; color: black; font-family:Arial, sans-serif; font-style: normal; font-weight: bold; text-decoration: none; font-size: 14pt; }
#l3> li:first-child>*:first-child:before {counter-increment: e1 0; }
li {display: block; }
#l4 {padding-left: 0pt;counter-reset: f1 3; }
#l4> li>*:first-child:before {counter-increment: f1; content: counter(f1, decimal)". "; color: black; font-family:Arial, sans-serif; font-style: normal; font-weight: bold; text-decoration: none; font-size: 18pt; }
#l4> li:first-child>*:first-child:before {counter-increment: f1 0; }
#l5 {padding-left: 0pt; }
#l5> li>*:first-child:before {content: "• "; color: black; font-family:"Times New Roman", serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
li {display: block; }
#l6 {padding-left: 0pt;counter-reset: g1 5; }
#l6> li>*:first-child:before {counter-increment: g1; content: counter(g1, decimal)". "; color: black; font-style: normal; font-weight: normal; text-decoration: none; }
#l6> li:first-child>*:first-child:before {counter-increment: g1 0; }
#l7 {padding-left: 0pt; }
#l7> li>*:first-child:before {content: "• "; color: black; font-family:"Times New Roman", serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
#l8 {padding-left: 0pt;counter-reset: g2 1; }
#l8> li>*:first-child:before {counter-increment: g2; content: counter(g2, decimal)". "; color: black; font-style: normal; font-weight: normal; text-decoration: none; }
#l8> li:first-child>*:first-child:before {counter-increment: g2 0; }
#l9 {padding-left: 0pt; }
#l9> li>*:first-child:before {content: "• "; color: black; font-family:"Times New Roman", serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
#l10 {padding-left: 0pt;counter-reset: g3 1; }
#l10> li>*:first-child:before {counter-increment: g3; content: counter(g3, decimal)". "; color: black; font-family:"Times New Roman", serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
#l10> li:first-child>*:first-child:before {counter-increment: g3 0; }
li {display: block; }
#l11 {padding-left: 0pt;counter-reset: i1 10; }
#l11> li>*:first-child:before {counter-increment: i1; content: counter(i1, decimal)". "; color: black; font-style: normal; font-weight: normal; text-decoration: none; }
#l11> li:first-child>*:first-child:before {counter-increment: i1 0; }
#l12 {padding-left: 0pt; }
#l12> li>*:first-child:before {content: "• "; color: black; font-family:"Times New Roman", serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
#l13 {padding-left: 0pt;counter-reset: i2 11; }
#l13> li>*:first-child:before {counter-increment: i2; content: counter(i2, decimal)". "; color: black; font-style: normal; font-weight: normal; text-decoration: none; }
#l13> li:first-child>*:first-child:before {counter-increment: i2 0; }
#l14 {padding-left: 0pt;counter-reset: i3 1; }
#l14> li>*:first-child:before {counter-increment: i3; content: counter(i3, decimal)". "; color: black; font-style: normal; font-weight: normal; text-decoration: none; }
#l14> li:first-child>*:first-child:before {counter-increment: i3 0; }
#l15 {padding-left: 0pt;counter-reset: i3 1; }
#l15> li>*:first-child:before {counter-increment: i3; content: counter(i3, decimal)". "; color: black; font-style: normal; font-weight: normal; text-decoration: none; }
#l15> li:first-child>*:first-child:before {counter-increment: i3 0; }
#l16 {padding-left: 0pt;counter-reset: k1 24; }
#l16> li>*:first-child:before {counter-increment: k1; content: counter(k1, lower-latin)" "; color: black; font-family:"Times New Roman", serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
#l16> li:first-child>*:first-child:before {counter-increment: k1 0; }
li {display: block; }
#l17 {padding-left: 0pt; }
#l17> li>*:first-child:before {content: "• "; color: black; font-family:"Times New Roman", serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
li {display: block; }
#l18 {padding-left: 0pt;counter-reset: l1 17; }
#l18> li>*:first-child:before {counter-increment: l1; content: counter(l1, decimal)". "; color: black; font-style: normal; font-weight: normal; text-decoration: none; }
#l18> li:first-child>*:first-child:before {counter-increment: l1 0; }
#l19 {padding-left: 0pt;counter-reset: l2 18; }
#l19> li>*:first-child:before {counter-increment: l2; content: counter(l2, decimal)". "; color: black; font-style: normal; font-weight: normal; text-decoration: none; }
#l19> li:first-child>*:first-child:before {counter-increment: l2 0; }
#l20 {padding-left: 0pt;counter-reset: l3 20; }
#l20> li>*:first-child:before {counter-increment: l3; content: counter(l3, decimal)". "; color: black; font-style: normal; font-weight: normal; text-decoration: none; }
#l20> li:first-child>*:first-child:before {counter-increment: l3 0; }
#l21 {padding-left: 0pt; }
#l21> li>*:first-child:before {content: "• "; color: black; font-family:"Times New Roman", serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
#l22 {padding-left: 0pt; }
#l22> li>*:first-child:before {content: "• "; color: black; font-family:"Times New Roman", serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
#l23 {padding-left: 0pt;counter-reset: l4 22; }
#l23> li>*:first-child:before {counter-increment: l4; content: counter(l4, decimal)". "; color: black; font-style: normal; font-weight: normal; text-decoration: none; }
#l23> li:first-child>*:first-child:before {counter-increment: l4 0; }
#l24 {padding-left: 0pt;counter-reset: l4 23; }
#l24> li>*:first-child:before {counter-increment: l4; content: counter(l4, decimal)". "; color: black; font-style: normal; font-weight: normal; text-decoration: none; }
#l24> li:first-child>*:first-child:before {counter-increment: l4 0; }
#l25 {padding-left: 0pt;counter-reset: l4 24; }
#l25> li>*:first-child:before {counter-increment: l4; content: counter(l4, decimal)". "; color: black; font-style: normal; font-weight: normal; text-decoration: none; }
#l25> li:first-child>*:first-child:before {counter-increment: l4 0; }
#l26 {padding-left: 0pt; }
#l26> li>*:first-child:before {content: "• "; color: black; font-family:"Times New Roman", serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
li {display: block; }
#l27 {padding-left: 0pt; }
#l27> li>*:first-child:before {content: "• "; color: black; font-family:"Times New Roman", serif; font-style: normal; font-weight: normal; text-decoration: none; font-size: 10pt; }
</style></head><body><p style="padding-left: 47pt;text-indent: 0pt;text-align: left;"><span><img width="137" height="18" alt="image" src="Image_001.png"/></span></p><p class="s1" style="padding-bottom: 3pt;padding-left: 44pt;text-indent: 0pt;line-height: 27pt;text-align: left;"><a name="bookmark0">Venue Medley for the Novice</a></p><p style="padding-left: 5pt;text-indent: 0pt;text-align: left;"><span><img width="137" height="18" alt="image" src="Image_002.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-top: 18pt;padding-left: 239pt;text-indent: 0pt;line-height: 11pt;text-align: left;"><a name="a0">Release 2.0</a></h4><h4 style="padding-left: 239pt;text-indent: 0pt;line-height: 11pt;text-align: left;">February, 1992</h4><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_003.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 53pt;text-indent: 0pt;line-height: 11pt;text-align: left;">Address comments to:</p><p style="padding-left: 53pt;text-indent: 0pt;line-height: 11pt;text-align: left;">Venue</p><p style="padding-left: 53pt;text-indent: 0pt;text-align: left;">User Documentation 1549 Industrial Road</p><p style="padding-bottom: 1pt;padding-left: 53pt;text-indent: 0pt;text-align: left;">San Carlos, CA 94070 415-508-9672</p><p style="padding-left: 53pt;text-indent: 0pt;line-height: 2pt;text-align: left;"><span><img width="412" height="3" alt="image" src="Image_004.png"/></span></p><p style="padding-top: 8pt;padding-left: 53pt;text-indent: 0pt;line-height: 174%;text-align: left;">Medley for the Novice Release 2.0</p><p style="padding-left: 53pt;text-indent: 0pt;line-height: 12pt;text-align: left;">February 1992</p><p style="padding-top: 8pt;padding-left: 53pt;text-indent: 0pt;line-height: 169%;text-align: left;">Copyright <span class="s2"></span> 1992 by Venue. All rights reserved.</p><p style="padding-left: 53pt;text-indent: 0pt;text-align: left;">Medley is a trademark of Venue.</p><p style="padding-top: 9pt;padding-left: 53pt;text-indent: 0pt;line-height: 87%;text-align: left;">Xerox<span class="s2"></span> is a registered trademark and InterPress is a trademark of Xerox Corporation.</p><p style="padding-top: 8pt;padding-left: 53pt;text-indent: 0pt;line-height: 169%;text-align: left;">UNIX<span class="s2"></span> is a registered trademark of UNIX System Laboratories. Post Script is a registered trademark of Adobe Systems Inc.</p><p style="padding-left: 53pt;text-indent: 0pt;line-height: 11pt;text-align: left;">Copyright protection includes material generated from the</p><p style="padding-left: 53pt;text-indent: 0pt;line-height: 87%;text-align: left;">software programs displayed on the screen, such as icons, screen display looks, and the like.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 53pt;text-indent: 0pt;line-height: 2pt;text-align: left;"><span><img width="414" height="3" alt="image" src="Image_005.png"/></span></p><p style="padding-top: 9pt;padding-left: 53pt;text-indent: 0pt;line-height: 87%;text-align: left;">The information in this document is subject to change without notice and should not be construed as a commitment by Venue. While every effort has been made to ensure the accuracy of this document, Venue assumes no responsibility for any errors that may appear.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 53pt;text-indent: 0pt;line-height: 87%;text-align: left;">Text was written and produced with Venue text formatting tools; Xerox printers were used to produce text masters. The typeface is Classic.</p><ol id="l1"><li><h1 style="padding-top: 3pt;padding-left: 60pt;text-indent: -25pt;text-align: left;"><a name="bookmark1">BRIEF GLOSSARY</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_006.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">The following definitions will acquaint you with general terms used throughout this primer. You will probably want to read through them now, and use this chapter as a reference while you read through the rest of the primer.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 227pt;text-indent: -59pt;text-align: left;">advising A Medley facility for specifying function modifications without necessarily knowing how a particular function works or even what it does. Even system functions can be changed with</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">advising.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -65pt;text-align: left;">argument A piece of information given to a Lisp function so that it can execute successfully. When a function is explained in the</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">primer, the arguments that it requires will also be given. Arguments are also called Parameters.</p><p style="padding-top: 7pt;padding-left: 183pt;text-indent: 0pt;text-align: left;">atom The smallest structure in Lisp; like a variable in other</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">programming languages, but can also have a property list and a function definition.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -103pt;text-align: left;">Background Menu The menu that appears when the mouse is not in any window and the right mouse button is pressed.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -55pt;text-align: left;">binding The value of a variable. It could be either a local or a global variable. See unbound.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -53pt;text-align: justify;">bitmap A rectangular array of &quot;pixels,&quot; each of which is on or off representing one point in the bitmap image.</p><p class="s3" style="padding-top: 7pt;padding-left: 227pt;text-indent: -50pt;line-height: 106%;text-align: justify;">BREAK <span class="p">An Lisp function that causes a function to stop executing, open a Break window, and allows you to find out what is happening while the function is halted.</span></p><p style="padding-top: 6pt;padding-left: 137pt;text-indent: 0pt;text-align: left;">Break Window A window that opens when an error is encountered while</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">running your program (i.e., when your program has broken).</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">There are tools to help you debug your program from this window. This is explained further in Chapter 14.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -53pt;text-align: left;">browse To examine a data structure by use of a display that allows you to &quot;move&quot; around within the data structure.</p><p style="padding-top: 7pt;padding-left: 178pt;text-indent: 0pt;text-align: left;">button (1) (n.) A key on a mouse.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: 0pt;text-align: left;">(2) (v.t.) To press one of the mouse keys when making a selection.</p><p class="s3" style="padding-top: 7pt;padding-left: 188pt;text-indent: 0pt;text-align: left;">CAR <span class="p">A function that returns the head or first element of a list. See</span></p><p class="s3" style="padding-left: 227pt;text-indent: 0pt;text-align: left;">CDR<span class="p">.</span></p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -44pt;text-align: left;">caret The small blinking arrowhead that marks where text will appear when it is typed in from the keyboard.</p><p class="s3" style="padding-top: 7pt;padding-left: 227pt;text-indent: -38pt;line-height: 107%;text-align: left;">CDR <span class="p">A function that returns the tail (that is, everything but the first element) of a list. See </span>CAR<span class="p">.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 227pt;text-indent: -50pt;text-align: left;">CLlSP A mechanism for augmenting the standard Lisp syntax. One such augmentation included in Interlisp is the iterative</p><p style="padding-left: 197pt;text-indent: 30pt;line-height: 165%;text-align: left;">statement. See Chapter 9. cr Press your Return key.</p><p style="padding-left: 227pt;text-indent: -58pt;text-align: left;">datatype (1) The kind of a datum. In Interlisp, there are many system- defined datatypes, e.g., Floating-Point, Integer, Atom, etc.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: 0pt;text-align: left;">(2) A datatype can also be user-defined. In this case, it is like a record made up from system types and other user-defined datatypes.</p><p class="s3" style="padding-top: 7pt;padding-left: 227pt;text-indent: -45pt;text-align: left;">DWIM <span class="p">&quot;Do-what-I-mean.&quot; Many errors made by Medley users could be corrected without any information about the purpose of the program or expression in question (e.g., misspellings, certain kinds of parenthesis errors). The </span>DWIM <span class="p">facility is called</span></p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">automatically whenever an error occurs in the evaluation of an Interlisp expression. If <span class="s3">DWIM </span>is able to make a correction, the computation continues as though no error had occurred; otherwise, the standard error mechanism is invoked.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -43pt;text-align: justify;">error Occasionally, while a program is running, an error may occur which will stop the computation. Interlisp provides extensive facilities for detecting and handling error conditions, to</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: justify;">enable the testing, debugging, and revising of imperfect programs.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -99pt;line-height: 107%;text-align: left;">evaluate or <span class="s3">EVAL </span>To find the value of a form. For example, if the variable <span class="s3">X </span>is bound to 5, we get 5 by evaluating <span class="s3">X</span>. Evaluation of a Lisp function involves evaluating the arguments and then</p><p style="padding-left: 227pt;text-indent: 0pt;line-height: 11pt;text-align: left;">applying the function.</p><p style="padding-top: 7pt;padding-left: 120pt;text-indent: 0pt;text-align: left;">Executive Window This is your main window, where you will run functions and</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">develop your programs. This is the window that the caret is in when you turn on your machine and load Medley.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -75pt;text-align: left;">file package A set of functions and conventions that facilitate the bookkeeping involved with working in a large system consisting of many source code files and their compiled counterparts. Essentially, the file package keeps track of</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">where things are and what things have changed. It also keeps track of which files have been modified and need to be</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">updated and recompiled.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -42pt;text-align: left;">form Another way of saying s-expression. A Lisp expression that can be evaluated.</p><p style="padding-top: 1pt;padding-left: 174pt;text-indent: -6pt;line-height: 19pt;text-align: left;">function A piece of Lisp code that executes and returns a value. history The programmers assistant is built around a memory</p><p style="padding-left: 227pt;text-indent: 0pt;line-height: 10pt;text-align: left;">structure called the history list. The history functions (e.g.</p><p class="s3" style="padding-left: 227pt;text-indent: 0pt;line-height: 107%;text-align: left;">FIX<span class="p">, </span>UNDO<span class="p">, </span>REDO<span class="p">) are part of this assistant. These operations allow you to conveniently rework previously specified</span></p><p style="padding-left: 227pt;text-indent: 0pt;line-height: 11pt;text-align: left;">operations.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -76pt;text-align: justify;">History List As you type on the screen, you will notice a number followed by a slash, followed by another number. The first number is the exec number, the second is the event number. Each</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: justify;">number, and the information on that line, is stored</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: justify;">sequentially as the History List Using the History List, you</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 227pt;text-indent: 0pt;text-align: left;">can easily reexecute lines typed earlier in a work session. See Chapter 2.</p><p style="padding-top: 7pt;padding-left: 187pt;text-indent: 0pt;text-align: left;">icon A pictorial representation, usually of a shrunken window.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -63pt;text-align: justify;">inspector An interactive display program for examining and changing the parts of a data structure. Medley has inspectors for lists and other data types.</p><p style="padding-top: 7pt;padding-left: 117pt;text-indent: 0pt;text-align: left;">iterative statement (also called i.s.) A statement in Interlisp that repetitively</p><p style="padding-left: 227pt;text-indent: 0pt;line-height: 107%;text-align: left;">executes a body of code For example, <span class="s3">(for x from l to 5 do (PRlNT x)) </span>is an i.s.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -100pt;text-align: left;">iterative variable (also called i.v.) Usually, an iterative statement is controlled by the value that the i.v. takes on. In the iterative statement</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">example above, x is the iterative variable because its value is being changed by each cycle through the loop. All iterative</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">variables are local to the iterative statement where they are defined.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -40pt;text-align: left;">Lisp Family of languages invented for &quot;list processing.&quot; These languages have in common a set of basic primitives for</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">creating and manipulating symbol structures. Interlisp-D is an implementation of the Lisp language together with an</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">environment (set of tools) for programming, and a set of packages that extend the functionality of the system.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -35pt;text-align: left;">list A collection of atoms and lists; a list is denoted by surrounding its contents with a pair of parentheses.</p><p style="padding-top: 7pt;padding-left: 148pt;text-indent: 0pt;text-align: left;">Masterscope A program analysis tool. When told to analyze a program,</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">Masterscope creates a database of information about the</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">program. In particular, Masterscope knows which functions call other functions and which functions use which variables.</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">Masterscope can then answer questions about the program and display the information with a browser.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -46pt;text-align: left;">menu A way of graphically presenting you with a set of options.</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">There are two kinds of menus: pop-up menus are created</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">when needed and disappear after an item has been selected; permanent menus remain on the screen after use until</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">deliberately closed.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -50pt;text-align: left;">mouse The mouse is the box attached to your keyboard. It controls the movement of the cursor on your screen. As you become</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">familiar with the mouse, you will find it much quicker to use the mouse than the keyboard.</p><p style="padding-top: 7pt;padding-left: 141pt;text-indent: 0pt;text-align: left;">Mouse Cursor The small arrow on the screen that points to the northwest.</p><p style="padding-top: 7pt;padding-left: 117pt;text-indent: 0pt;text-align: left;">Mouse Cursor Icons Four types of mouse cursor icons are shown below.</p><p style="padding-top: 9pt;padding-left: 190pt;text-indent: 0pt;text-align: left;"><span><img width="20" height="21" alt="image" src="Image_007.gif"/></span> Wait. The processor is busy.</p><p style="padding-top: 9pt;padding-left: 227pt;text-indent: -33pt;text-align: left;"><span><img width="17" height="21" alt="image" src="Image_008.gif"/></span> The Mouse Confirm Cursor. It appears when you have to confirm that the choice you just made was correct. If it was, press the left button. If the choice was not correct, press the right button to abort.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><span><img width="21" height="19" alt="image" src="Image_009.gif"/></span></p><p style="padding-top: 4pt;padding-left: 227pt;text-indent: 0pt;text-align: left;">This means &quot;sweep out&quot; the shape of the window. To do this, move the mouse to a position where you want a corner. Press the left mouse button, and hold it down. Move the mouse</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">diagonally to sketch a rectangle. When the rectangle is the desired size and shape, release the left button.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><span><img width="16" height="16" alt="image" src="Image_010.gif"/></span></p><p style="padding-top: 4pt;padding-left: 227pt;text-indent: 0pt;text-align: left;">This is the &quot;move window&quot; prompt. Move the mouse so that the large &quot;ghost&quot; rectangle is in the position where you want the window. When you click the left mouse button, the</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">window will appear at this new location.</p><p class="s3" style="padding-top: 7pt;padding-left: 227pt;text-indent: -39pt;line-height: 107%;text-align: left;">NIL NIL <span class="p">is the Lisp symbol for the empty list. It can also be represented by a left parenthesis followed by a right</span></p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">parenthesis ( ). It is the only expression in Lisp that is both an atom and a list.</p><p style="padding-top: 6pt;padding-left: 184pt;text-indent: 0pt;text-align: justify;">pixel Pixel stands for &quot;picture element.&quot; The computer monitor</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: justify;">screen is made up of a rectangular array of pixels. Each pixel corresponds to one bit. When a bit is turned on (i.e., set to 1), the pixel on the screen represented by this bit is black.</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -89pt;text-align: left;">pretty printing Pretty printing refers to the way Lisp functions are printed with special indentation, to make them easier to read.</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">Functions are pretty printed in the structure editor, SEdit</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">(see Chapter 7). You can pretty print uncompiled functions by calling the function <span class="s3">PP </span>with the function you would like to</p><p style="padding-left: 227pt;text-indent: 0pt;line-height: 107%;text-align: left;">see as an argument, i.e. (<span class="s3">PP </span>function-name). For an example of this, see Figure 1.5.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 242pt;text-indent: 0pt;text-align: left;"><span><img width="344" height="230" alt="image" src="Image_011.gif"/></span></p><p style="padding-top: 3pt;padding-left: 252pt;text-indent: 0pt;text-align: left;">Figure 1.5. Example of Pretty Printing Function <span class="s3">PP</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 141pt;text-indent: 0pt;text-align: left;">Programmers</p><p style="padding-left: 227pt;text-indent: -64pt;text-align: left;">Assistant The programmers assistant accesses the History List to allow you to <span class="s3">FIX</span>, <span class="s3">UNDO</span>, and/or <span class="s3">REDO </span>your previous expressions</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">typed to the executive window (see Chapter 2).</p><p style="padding-top: 7pt;padding-left: 227pt;text-indent: -95pt;text-align: left;">Prompt Window The narrow black window at the top of the screen. It displays system prompts, or prompts you have developed (see Figure 1.6).</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 270pt;text-indent: 0pt;text-align: left;"><span><img width="267" height="101" alt="image" src="Image_012.gif"/></span></p><p style="padding-top: 4pt;padding-left: 307pt;text-indent: 0pt;text-align: left;">Figure 1.6. Prompt Window</p><p style="padding-top: 7pt;padding-left: 149pt;text-indent: 0pt;text-align: left;">property list A list of the form ( &lt;property-namel&gt; &lt;property-value1&gt;</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">&lt;property-name2&gt; &lt;property-value2&gt; ....) associated with an atom. It accessed by the functions <span class="s3">GETPROP </span>and <span class="s3">PUTPROP</span>.</p><p style="padding-top: 7pt;padding-left: 177pt;text-indent: 0pt;text-align: left;">record A record is a data structure that consists of named &quot;fields&quot;.</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">Accessing elements of a record can be separated from the details of how the data structure is actually stored. This</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">eliminates many programming details. A record definition</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">establishes a record template, describing the form of a record. A record instance is an actual record storing data according to a particular record template. (See datatype, second</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">definition.)</p><p style="padding-top: 7pt;padding-left: 108pt;text-indent: 0pt;text-align: left;">Right Button Default</p><p style="padding-left: 139pt;text-indent: 0pt;text-align: left;">Window Menu This is the menu that appears when the mouse is in a</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">window, and the right mouse button is pressed. It looks like the menu in Figure 1.7. If this menu does not appear when you press the right button of the mouse and the mouse is in</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">the window, move the mouse so that it is pointing to the title bar of the window, and press the right button.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 344pt;text-indent: 0pt;text-align: left;"><span><img width="71" height="134" alt="image" src="Image_013.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 260pt;text-indent: 0pt;text-align: left;">Figure 1.7. Right Button Default Window Menu</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 227pt;text-indent: -77pt;text-align: justify;">s-expression Short for &quot;symbolic expression&quot;. In Lisp, this refers to any well-formed collection of left parentheses, atoms, and right parentheses.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 227pt;text-indent: -45pt;text-align: left;">stack A pushdown list. Whenever a function is entered, information about that specific function call is pushed onto (i.e., added to</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">the front of) the stack. This information includes the variable names and their values associated with the function call.</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">When the function is exitted, that data is popped off the stack.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 176pt;text-indent: 0pt;text-align: left;">sysout A flle containing a whole Lisp environment: namely,</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">everything you defined or loaded into the environment, the windows that appeared on the screen, the amount of memory</p><p style="padding-left: 227pt;text-indent: 0pt;text-align: left;">used, and so on. Everything is stored in the sysout file exactly as it was when the function <span class="s3">SYSOUT </span>was called.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 4pt;padding-left: 176pt;text-indent: 0pt;text-align: justify;">TRACE <span class="p">A function that creates a trace of the execution of another</span></p><p style="padding-left: 227pt;text-indent: 0pt;text-align: justify;">function. Each time the traced function is called, it prints out the values of the arguments it was called with, and prints out the value it returns upon completion.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 227pt;text-indent: -61pt;text-align: left;">unbound Without value; an atom is unbound if a value has never been assigned to it.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 227pt;text-indent: -56pt;text-align: left;">window A rectangular area of the screen that acts as the main display area for some Lisp process,</p><h1 style="padding-top: 3pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="bookmark2">PREFACE</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_014.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s4" style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">It was dawn and the local told him it was down the road a piece, left at the first fishing bridge in the country, right at the appletree stump, and onto the dirt road just before the hill. At midnight he knew he was lost. <span class="p">-Anonymous</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Welcome to the Medley Lisp Development Environment, a collection of powerful tools for assisting you in programming in Lisp, developing sophisticated user interfaces, and creating prototypes of your ideas in a quick and easy manner. Unfortunately, along</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">with the power comes mind-numbing complexity. The Medley documentation set</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">describes all the tools in detail, but it would be unreasonable for us to expect a new user to wade through all of it, so this primer is intended as an introduction, to give you a</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">taste of some of the features.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">We developed this primer to provide a starting point for new Medley users, to enhance your excitement and challenge you with the potential before you. Were going to make some assumptions about you. For starters, were going to assume that youre sitting at a workstation that can run Medley. All of the examples in the book figure that youre</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">going to want to try things out. Were also going to assume that youve had some exposure to Lisp, hopefully Common Lisp.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Medley actually consists of two complete Lisp implementations, Common Lisp and InterLisp. All the screen I/O and some of the system functions are in InterLisp.</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">However, thanks to the package system, you can call back and forth between the two languages by simply including a package delimiter in front of a symbol name. This sounds complicated, but it will become clearer once we do some examples.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">Throughout we make reference to the <i>lnterlisp-D Reference Manual </i>by section and page number. The material in the primer is just an introduction. When you need more depth, use the detailed treatment provided in the manual.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">While only you can plot your ultimate destination, you will flnd this primer</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">indispensable for clearly defining and guiding you to the first landmarks on your way.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s5" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Acknowledgements</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The early inspiration and model for this primer came from the Intelligent Tutoring</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Systems group and the Learning Research and Development Center at the University of Pittsburgh. We gratefully acknowledge their pioneering contribution to more effective</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">artificial intelligence.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">This primer was originally developed by Computer Possibilities, a company committed to making Al technology available. Primary development and writing was done by</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Cynthia Cosic, with technical writing support provided by Sam Zordich. It has been re- done by Venue staff to reflect changes in the environment since the original publication.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">At Xerox Artificial Intelligence Systems, John Vittal managed and directed the project. Substantial assistance was provided by many members of the AlS staff who provided both editorial and systems support.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_015.png"/></span></p><p class="s6" style="padding-left: 35pt;text-indent: 0pt;text-align: left;">Medley for the Novice, Release 2.0</p><p class="s6" style="padding-top: 2pt;text-indent: 0pt;text-align: right;">vii</p><p class="s7" style="padding-top: 3pt;padding-left: 35pt;text-indent: 0pt;text-align: left;">PREFACE </p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 209pt;text-indent: 0pt;text-align: left;">[This page intentionally left blank]</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_016.png"/></span></p><p class="s8" style="padding-left: 35pt;text-indent: 0pt;text-align: left;">viii <span class="s6">Medley for the Novice, Release 2.0</span></p></li><li><h1 style="padding-top: 3pt;padding-left: 60pt;text-indent: -25pt;text-align: left;"><a name="bookmark3">TYPING SHORTCUTS</a></h1></li></ol><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_017.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Once you have logged in to Medley, you are in Lisp. The functions you type into the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Executive Window will now execute, that is, perform the designated task. Lisp is case-</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">sensitive; it often matters whether text is typed in upper- or lowercase letters. Use the Shift-Lock key on your keyboard to ensure that everything typed is in capital letters.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">You must type all Lisp functions in parentheses. The Lisp interpreter will read from the left parenthesis to the closing right parenthesis to determine both the function you want to execute and the arguments to that function. Executing this function is called</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">&quot;evaluation.&quot; When the function is evaluated, it returns a value, which is then printed in the Executive Window. This entire process is called the read-eval-print loop, and is how most Lisp interpreters, including the one for Lisp, run.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The prompt in is a number followed by a left-pointing arrow (see Figure 2.3). This number is the functions position on the History List—a list that stores your</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">interactions with the Lisp interpreter. Type the function <span class="s3">(PLUS 3 4) </span>, and notice the History List assigns to the function (the number immediately to the left of the arrow).</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Lisp reads in the function and its arguments, evaluates the function, and then prints the number 7.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a1">Programmers Assistant </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">In addition to this read-eval-print loop, there is also a &quot;programmers assistant.&quot; It is the programmers assistant that prints the number as part of the prompt in the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">executive window, and uses these numbers to reference the function calls typed after them.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">When you issue commands to the programmers assistant, you will not use parentheses as you do with ordinary functiion calls. You simply type the command, and some</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">specification that indicates which item on the history list the command refers to. Some programmers assistant commands are <span class="s3">FIX</span>, <span class="s3">REDO</span>, and <span class="s3">UNDO</span>. They are explained in</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">detail below.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">Programmers assistant commands are useful only at the Lisp top level, that is, when you are typing into the Executive Window. They do not work in user-defined functions.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">As an example use of the programmers assistant, use <span class="s3">REDO </span>to redo your function call</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;"><span class="s3">(PLUS 3 4)</span>. Type <span class="s9">REDO </span>at the prompt (programmers assistant commands can be</p><p style="padding-left: 106pt;text-indent: 0pt;text-align: left;">typed in either upper- or lowercase) , then specify the previous expression in one of the following ways:</p><ul id="l2"><li><p style="padding-top: 7pt;padding-left: 117pt;text-indent: -9pt;text-align: left;">When you originally typed in the function you now want to refer to, there was a</p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">History List number to the left of the arrow in the prompt. Type this number after the programmers assistant command. This is the method illustrated in Figure 2-1.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 224pt;text-indent: 0pt;text-align: left;"><span><img width="228" height="116" alt="image" src="Image_018.gif"/></span></p><p style="padding-top: 7pt;padding-left: 137pt;text-indent: 0pt;text-align: left;">Figure 2-1. Using a Programmers Assistant Command to <span class="s3">REDO </span>a Function</p><p style="text-indent: 0pt;text-align: left;"><br/></p></li><li><p style="padding-top: 4pt;padding-left: 119pt;text-indent: -10pt;text-align: justify;">A negative number will specify the function call typed in that number of prompts dago. In this example, you would type in -1, the position immediately before the current position. This is shown in Figure 2-2.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 225pt;text-indent: 0pt;text-align: left;"><span><img width="228" height="116" alt="image" src="Image_019.gif"/></span></p><p style="padding-top: 8pt;padding-left: 119pt;text-indent: 0pt;text-align: left;">Figure 2-2. Using a Negative Number after the Programmers Assistant Command</p></li><li><p style="padding-top: 7pt;padding-left: 119pt;text-indent: -10pt;text-align: left;">You can also specify the function for the programmers assistant with one of the items that was in that function call. The programmers assistant will search</p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">backwards in the History List, and use the first function it finds that includes that</p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">item. For example, type <span class="s9">REDO PLUS </span>to have the functiion <span class="s3">(PLUS 3 4) </span>reevaluated.</p></li><li><p style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: justify;">If you type a programmers assistant cmmand without specifying a function (i.e., simply typing the command, following by a Return), the programmers assistant executes the command using the function entered at the previous prompt.</p></li></ul><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Figure 2-3 shows a few more examples of how to use the programmers assistant.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 197pt;text-indent: 0pt;text-align: left;"><span><img width="305" height="286" alt="image" src="Image_020.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 168pt;text-indent: 0pt;text-align: left;">Figure 2-3. Some Applications of the Programmers Assistant</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a2">If You Make a Mistake </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Editing in the Executive Window is explained in detail in Chapter 7. In the following section, only a few of the most useful commands are repeated.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To move the caret to a new place in the command being typed, point the mouse cursor at the appropriate position. Then press the left mouse button.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To move the caret back to the end of the command being typed, press Control-X (hold the Control key down, and type <b>X</b>).</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To delete:</p><p style="padding-top: 7pt;padding-left: 131pt;text-indent: 0pt;text-align: left;">Character behind the caret Press the Backspace key</p><p style="padding-top: 7pt;padding-left: 131pt;text-indent: 0pt;text-align: left;">Word behind the caret Press Control-W (hold the Control key down and type</p><p style="padding-left: 263pt;text-indent: 0pt;text-align: left;">W)</p><p style="padding-top: 7pt;padding-left: 131pt;text-indent: 0pt;text-align: left;">Any part of the command Move the caret to the appropriate place in the</p><p style="padding-left: 263pt;text-indent: 0pt;text-align: left;">command. Hold the right mouse button down and move the the mouse cursor over the text. All of the</p><p style="padding-left: 263pt;text-indent: 0pt;text-align: left;">blackened text between the caret and mouse cursor is deleted when you release the right mouse button.</p><p style="padding-top: 7pt;padding-left: 131pt;text-indent: 0pt;text-align: left;">Entire command Press Control-U (hold the Control key down and type</p><p class="s10" style="padding-left: 263pt;text-indent: 0pt;text-align: left;">U<span class="p">)</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Deletions can be undone. J ust press the <span class="s3">UNDO </span>key.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To add more text to the line, move the carent to the appropriate position and start to type. Whatever you type will appear at the caret.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 209pt;text-indent: 0pt;text-align: left;">[This page intentionally left blank]</p><p style="text-indent: 0pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_021.png"/></span></p><h1 style="padding-top: 3pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="bookmark4">TABLE of CONTENTS</a></h1><p class="s5" style="padding-top: 39pt;padding-left: 35pt;text-indent: 0pt;text-align: left;">Preface <span class="s6">vii</span></p><ol id="l3"><li><p class="s5" style="padding-top: 25pt;padding-left: 54pt;text-indent: -19pt;text-align: left;">Brief Glossary <span class="s6">1-1</span></p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 50pt;text-indent: -15pt;text-align: left;">Typing Shortcuts</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Programmers Assistant 2-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">If You Make a Mistake 2-2</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 50pt;text-indent: -15pt;text-align: left;">Using Menus</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Making a Selection from a Menu 3-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Explanations of Menu Items 3-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Submenus 3-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Summary 3-3</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 50pt;text-indent: -15pt;text-align: left;">How to Use Files</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Types of Files 4-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Directories 4-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Directory Options 4-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Subdirectories 4-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">To See What Files Are Loaded 4-3</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Simple Commands for Manipulating Files 4-3</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Connecting to a Directory 4-3</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">File Version Numbers 4-4</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 50pt;text-indent: -15pt;text-align: left;">FileBrowser</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Calling the FileBrowser 5-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">FileBrowser Commands 5-3</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 50pt;text-indent: -15pt;text-align: left;">Those Wondertul Windows!</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Windows Provided by Medley 6-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Creating a Window 6-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Right Button Default Window Menu 6-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Explanation of Each Menu Item 6-3</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Scrollable Windows 6-4</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Other Window Functions 6-5</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">PROMPTPRlNT 6-5</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">WHlCHW 6-6</p></li><li><p class="s5" style="padding-top: 19pt;padding-left: 50pt;text-indent: -15pt;text-align: left;">Editing and Saving</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Defining Functions 7-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Simple Editing in the Executive Window 7-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Using the List Structure Editor 7-3</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Commenting Functions 7-4</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">File Functions and Variables: How to See and Save Them 7-5</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">File Variables 7-5</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Saving Interlisp-D on Files 7-5</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 50pt;text-indent: -15pt;text-align: left;">Your Init File</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Using the USERGREETFILES Variable 8-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Making an Init File 8-1</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 50pt;text-indent: -15pt;text-align: left;">Medley Forgiveness: DWIM <span class="s6">9-1</span></p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 58pt;text-indent: -23pt;text-align: left;">Break Package</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Break Windows 10-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Break Package Examples 10-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Ways to Stop Execution from the Keyboard (Breaking Lisp) 10-3</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Break Menu 10-3</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Returning to Top Level 10-4</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 58pt;text-indent: -23pt;text-align: left;">WhatTo Do lf <span class="s6">11-1</span></p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 58pt;text-indent: -23pt;text-align: left;">Window and Regions</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Windows 12-1</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">CREATEW 12-1</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">WlNDOWPROP 12-2</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Getting Windows to Do Things 12-3</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">BUTTONEVENTFN 12-5</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Looking at a Windows Properties 12-5</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Regions 12-5</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 58pt;text-indent: -23pt;text-align: left;">What Are Menus?</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Displaying Menus 13-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Getting Menus to Do Stuff 13-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">WHENHELDFN and WHENSELECTEDFN Fields of a Menu 13-3</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Looking at a Menus Fields 13-5</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 58pt;text-indent: -23pt;text-align: left;">Bitmaps <span class="s6">14-1</span></p></li><li><p class="s5" style="padding-top: 18pt;padding-left: 58pt;text-indent: -23pt;text-align: left;">Displaystreams</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Drawing on a Displaystream 15-1</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">DRAWUNE 15-1</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">DRAWTO 15-2</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">DRAWCIRCLE 15-3</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">FILLCIRCLE 15-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Locating and Changing Your Position in a Displaystream 15-4</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">DSPXP0SITION 15-5</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">DSPYPOSlTION 15-5</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">MOVETO 15-5</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 58pt;text-indent: -23pt;text-align: left;">Fonts</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">What Makes Up a Font 16-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Fontdescriptors and FONTCREATE 16-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Display Fonts 16-3</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">InterPress Fonts 16-3</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Functions for Using Fonts 16-4</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">FONTPROP - Looking at Font Properties 16-4</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">STRINGWlDTH 16-5</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">DSPFONT- Changing the Font in One Window 16-5</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Personalizing Your Font Profile 16-6</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 58pt;text-indent: -23pt;text-align: left;">The Inspector</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Calling the Inspector 17-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Using the Inspector 17-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Inspector Example 17-2</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 58pt;text-indent: -23pt;text-align: left;">Masterscope</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">SHOW DATA Command and GRAPHER 18-2</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 58pt;text-indent: -23pt;text-align: left;">Where Does All the Time Go? SPY</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">How to Use Spy with the SPY Window 19-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">How to Use SPY from the Lisp Top Level 19-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Interpreting SPYs Results 19-2</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 62pt;text-indent: -27pt;text-align: left;">Free Menus</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Free Menu Example 20-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Parts of a Free Menu Item 20-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Types of Free Menu Items 20-3</p></li><li><p class="s5" style="padding-top: 19pt;padding-left: 62pt;text-indent: -27pt;text-align: left;">The Grapher</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Say it with Graphs 21-1</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Add a Node 21-2</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Add a Link 21-2</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Delete a Link 21-2</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Delete a Node 21-2</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Move a Node 21-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Making a Graph from a List 21-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Incorporating Grapher into Your Program 21-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">More of Grapher 21-2</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 62pt;text-indent: -27pt;text-align: left;">Resource Management</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Naming Variables and Records 22-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Some Space and Time Considerations 22-2</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Global Variables 22-3</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Circular Lists 22-3</p><p class="s6" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">When You Run Out of Space 22-4</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 58pt;text-indent: -23pt;text-align: left;">Simple Interactions with the Cursor, a Bitmap, and a Window</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">GETMOUSESTATE Example Function 23-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Advising GETMOUSESTATE 23-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Changing the Cursor 23-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Functions for Tracing the Cursor 23-3</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Running the Functions 23-6</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 58pt;text-indent: -23pt;text-align: left;">Glossary of Global System Variables</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Directories 24-1</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Flags 24-2</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">History Lists 24-3</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">System Menus 24-3</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Windows 24-4</p><p class="s6" style="padding-top: 5pt;padding-left: 83pt;text-indent: 0pt;text-align: left;">Miscellaneous 24-4</p></li><li><p class="s5" style="padding-top: 8pt;padding-left: 58pt;text-indent: -23pt;text-align: left;">Other Useful References <span class="s6">25.1</span></p></li></ol><p class="s5" style="padding-top: 24pt;padding-left: 35pt;text-indent: 0pt;text-align: left;">Index<span class="s6">.............................................................................................................................................. INDEX-1</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s6" style="padding-left: 61pt;text-indent: 0pt;text-align: center;">[This page intentionally left blank]</p><ol id="l4"><li><h1 style="padding-top: 3pt;padding-left: 60pt;text-indent: -25pt;text-align: left;"><a name="bookmark5">USING MENUS</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_022.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">The purpose of this chapter is to show you how to use menus. Many things can be done more easily using menus, and there are many different menus provided in the Medley</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">environment. Some are &quot;pop-up&quot; menus that are only available until a selection is made, then disappear until they are needed again. An example of one of these is the Background Menu that appears when the mouse is not in any window and the right</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">mouse button is pressed. A background menu is shown in Figure 3-1. Your background menu may have different items on it.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 261pt;text-indent: 0pt;text-align: left;"><span><img width="133" height="97" alt="image" src="Image_023.gif"/></span></p><p style="padding-top: 7pt;padding-left: 240pt;text-indent: 0pt;text-align: left;">Figure 3-1. Background Menu</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Another common pop-up menu is the right button default window menu. This menu is explained more in Chapter 6.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">Other menus are more permanent, such as the menu that is always available for use with the Filebrowser. This menu is shown in Figure 3-2., and the specifics of its use with the filebrowser are explained in Chapter 5.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 276pt;text-indent: 0pt;text-align: left;"><span><img width="92" height="161" alt="image" src="Image_024.gif"/></span></p><p style="padding-top: 8pt;padding-left: 241pt;text-indent: 0pt;text-align: left;">Figure 3-2. Filebrowser Menu</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a3">Making a Selection from a Menu </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">To make a selection from a menu, point with the mouse to the item you would like to select. If one of the mouse buttons is already pressed, the menu item should be</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">highlighted in reverse video. If it is a permanent menu, you must press the left mouse button to highlight the item. When you release the button,m the item will be selected. Figure 3-3 shows a menu with the item &quot;Undo&quot; chosen.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 291pt;text-indent: 0pt;text-align: left;"><span><img width="52" height="51" alt="image" src="Image_025.gif"/></span></p><p style="padding-top: 7pt;padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 3-3. Menu with the Item &quot;Undo&quot; Chosen</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a4">Explanation of Menu Items </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Many menu items have explanations associated with the. If you are not sure what the consequences of choosing a particular menu iem will be, highlight the menu item but do not releast the left mouse button. If the menu item has an explanation associated with it, the explanation will be printed in the prompt window. Figure 3-4 shows the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">explanation associated with the item &quot;Snap&quot; from the background menu.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 118pt;text-indent: 0pt;text-align: left;"><span><img width="513" height="83" alt="image" src="Image_026.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 260pt;text-indent: 0pt;text-align: left;"><span><img width="134" height="184" alt="image" src="Image_027.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 3-4. Explanation Associated with Selected Menu Item</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a5">Submenus </a></h2><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Some menu items have submenus associated with them. This means that, for these items, you can make even more precise choices if you would like to.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">A submenu can also be foun d as described below.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">As shown in Figure 3-5, a submenu can be indicated by a gray arrow to the right of the menu item. To see the submenu, highlight the menu item and move the mose to the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">right to follow the arrow. Choosing an item from a submenu is done the same way you make a choice from the menu. Any submenus that might be associated with the items in the submenu are indicated in the same way as the submenus associated with the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">items in the menu.</p><p class="s6" style="padding-top: 3pt;text-indent: 0pt;text-align: right;">3. USING MENUS</p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_028.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 254pt;text-indent: 0pt;text-align: left;"><span><img width="149" height="162" alt="image" src="Image_029.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 183pt;text-indent: 0pt;text-align: left;">Figure 3-5. Edit Submenu Displayed with Right Arrow</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a6">Summary </a></h2><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">In summary, here are a few rules of thumb to remember about the interactions of the mouse and system menus:</p><ul id="l5"><li><p style="padding-top: 7pt;padding-left: 118pt;text-indent: -10pt;text-align: left;">Press the left mouse button to select a menu item</p></li><li><p style="padding-top: 7pt;padding-left: 118pt;text-indent: -10pt;text-align: left;">Press the middle mouse button to get more options on a submenu</p></li><li><p style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">Press the right mouse button to see the default right button window menu, and the background menu</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 209pt;text-indent: 0pt;text-align: left;">[This page intentionally left blank]</p></li></ul></li><li><h1 style="padding-top: 3pt;padding-left: 60pt;text-indent: -25pt;text-align: left;"><a name="bookmark6">HOW TO USE FILES</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_030.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a7">Types of Files </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">A program file, or Lisp file, contains a series of expressions that can be read and</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">evaluated by the Lisp interpreter. These expressions can include function or macro</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">definitions, variables and their values, properties of variables, and so on. How to save Interlisp-D expressions on these files is explained in Chapter 7. Loading a file is</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">explained in the Simple Commands for Manipulating Files section below.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Not all files, however, have Lisp expressions stored on them. For example, TEdit files store text; sketches are stored on files made with the package Sketch , or can be</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">incorporated into TEdit files. These files are not loaded directly into the environment, but are accessed with the package used to create them, such as TEdit or Sketch.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">When you name a file, there are conventions that you should follow. These conventions allow you to tell the type of file by the extension to its name.</p><p class="s10" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;"><a name="a8">If a file contains: Then:</a></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Lisp expressions It should not have an extension or have the extension</p><p class="s3" style="padding-left: 251pt;text-indent: 0pt;line-height: 107%;text-align: left;">.LISP<span class="p">. For example, a file called </span>MYCODE <span class="p">should contain Lisp expressions.</span></p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Compiled Code It should have the extension <span class="s3">.LCOM or .DFASL</span>. For</p><p style="padding-left: 251pt;text-indent: 0pt;line-height: 107%;text-align: left;">example, a file called <span class="s3">MYCODE.DFASL </span>should contain compiled code.</p><p style="padding-top: 6pt;padding-left: 251pt;text-indent: -144pt;line-height: 107%;text-align: left;">A Sketch Its extension should be <span class="s3">.SKETCH</span>. For example, a file called <span class="s3">MOUNTAINS.SKETCH </span>should contain a Sketch.</p><p style="padding-top: 7pt;padding-left: 251pt;text-indent: -143pt;line-height: 107%;text-align: left;">Text It should have the extension <span class="s3">.TEDIT</span>. For example, a file called <span class="s3">REPORT.TEDIT </span>should contain text that can be edited with the editor <span class="s3">TEDIT</span>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a9">Directories </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">This section focu ses on how you can find files, and how you can easily manipulate files. To see all the files listed on a device, use the function <span class="s3">DIR</span>. For example, to see what files are stored in your current directory, type:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(DIR *.*)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">Partial directory listings can be gotten by specifying a file name, rather than just a</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: justify;">device name. The wildcard character <span class="s3">* </span>can be used to match any number of unknown characters. For example, the command <span class="s3">(DIR T*) </span>will list the names of all files that begin with the letter <span class="s3">T</span>. An example using the wildcard is shown in Figure 4-1.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 198pt;text-indent: 0pt;text-align: left;"><span><img width="300" height="139" alt="image" src="Image_031.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 220pt;text-indent: 0pt;text-align: left;">Figure 4-1. Using <span class="s3">DIR </span>with a Wildcard</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a10">Directory Options </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Various words can appear as extra arguments to the <span class="s3">DIR </span>command. these words give you extra information about the files.</p><p class="s3" style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">SIZE <span class="p">displays the size of each file in the directory. For example, type:</span></p><p class="s3" style="padding-top: 8pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(DIR {DSK} SIZE)</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">DATE <span class="p">displays the creation date of each file in the directory. An example of this is shown in Figure 4-2.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 198pt;text-indent: 0pt;text-align: left;"><span><img width="300" height="139" alt="image" src="Image_032.gif"/></span></p><p style="padding-top: 9pt;padding-left: 106pt;text-indent: 127pt;line-height: 164%;text-align: left;">Figure 4-2. Example Using <span class="s3">DATE DEL </span>deletes all the files foun d by the directory command.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 9pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a11">Subdirectories </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Sudirectories are very helpful for organizing files. A set of files that have a single</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">purpose (for example, all the external documentation files for a system) can be grouped together into a subdirectory.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To associate a subdirectory with a filename, simply include the desired subdirectory as part of the name of the file. Subdirectories are specified after the device name and</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">before the simple filename. The first subdirectory should be between less-than and</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">greater-than signs (angle brackets) &lt; &gt;, with nested subdirectory names only followed by a greater than sign &gt;. For example:</p><p class="s3" style="padding-top: 8pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">{DSK}&lt;Directory&gt;SubDirectory&gt;SubSubDirectory&gt;...&gt;filename</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">or use the UNIX convention:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">{DSK}/Directory/Subdirectory/Subsubdirectory/filename</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 4pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a12">To See What Files Are Loaded </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;line-height: 164%;text-align: left;">If you type <span class="s3">FILELST&lt;CR&gt;</span>, the names of all the files you loaded will be displayed. Type <span class="s3">SYSFILES&lt;CR&gt; </span>to see what files are loaded to create the sysout.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 9pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a13">Simple Commands for Manipulating Files </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">When using these functions, always be sure to specify the full filename, including subfile directories if appropriate.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To have the conents of a file displayed in a window:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(SEE <span class="s4">filename</span>)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To copy a file (see Figure 4-3):</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(COPYFILE <span class="s4">oldfilename </span><span class="s4">newfilename</span>)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 143pt;text-indent: 0pt;text-align: left;"><span><img width="447" height="114" alt="image" src="Image_033.gif"/></span></p><p style="padding-top: 7pt;padding-left: 221pt;text-indent: 0pt;text-align: left;">Figure 4-3. Example Use of <span class="s3">COPYFILE</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To delete a file (see Figure 4-4):</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(DELFILE <span class="s4">filename</span>)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 143pt;text-indent: 0pt;text-align: left;"><span><img width="447" height="114" alt="image" src="Image_034.gif"/></span></p><p style="padding-top: 7pt;padding-left: 224pt;text-indent: 0pt;text-align: left;">Figure 4-4. Example Use of <span class="s3">DELFILE</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To rename a file:</p><p class="s4" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;"><span class="s3">(RENAMEFILE </span>oldfilename <span class="p"></span>newfilename<span class="s3">)</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Files that contain Lisp expressions can be loaded into the environment. That means that the information on them is read, evaluated, and incorporated into the Medley</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">environment. To load a file, type:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(LOAD <span class="s4">filename</span>)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a14">Connecting to a Directory </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">Often, each person or project has a subdirectory where files are stored. If this is your situation, you will want any files you create to be put into this directory automatically. This means you should &quot;connect&quot; to the directory.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">CONN <span class="p">is the Medley command that connects you to a directory. For example, </span>CONN <span class="p">in Figure 4-5 connects you to the subsubdirectory </span>IM<span class="p">, in the subdirectory </span>PRIMER <span class="p">, the directory </span>LISPFILES<span class="p">, on the device </span>DSK<span class="p">. This information—the device and the</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">directory names down to the subdirectory to which you want to be connected—is called the &quot;path&quot; to that subdirectory. <span class="s3">CONN </span>expects the path to a directory as an argument.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 143pt;text-indent: 0pt;text-align: left;"><span><img width="447" height="114" alt="image" src="Image_035.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 156pt;text-indent: 0pt;text-align: left;">Figure 4-5. <span class="s3">CONN</span>ecting to Subdirectory Primer Subsubdirectory <span class="s3">IM</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Once you are connected to a directory, the command <span class="s3">DIR </span>will assume you want to see the files in that directory, or any of its subdirectories.</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">Other commands that require a filename as an argument (e.g., <span class="s3">SEE</span>, above) will assume that the file is in the connecteds directory if there is no path specified with the filename. This will often save you typing.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a15">File Version Numbers </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">When stored, each filename is fillowed by a semicolon and a number, as shown in this example:</p><p class="s3" style="padding-top: 8pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">MYFILE.TEDIT;1</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The number is the version number of the file. This is the systems way of protecting your files from being overwritten. Each time the file is written, a new file is created with a version number one greater than the last. This new file will have everything from your previous file, plus all of your changes.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">In most cases, you can exclude the version number when referencing the file. When the version is not specified, and there is more than one version of the file on that particular directory, the system generally uses your most recent version. An exception is the</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">function <span class="s3">DELFILE</span>, which deletes the oldest version (the one with the lowest version number) if none is specified.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 209pt;text-indent: 0pt;text-align: left;">[This page intentionally left blank]</p></li><li><h1 style="padding-top: 3pt;padding-left: 60pt;text-indent: -25pt;text-align: left;"><a name="bookmark7">FILEBROWSER</a></h1></li></ol><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_036.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 15pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The FileBrowser is a Lisp Library Package that works with files stored on disk and floppy devices, and can be used as a file directory editor. If it is not loaded into your sysout, you need to load it first by typing:</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(LOAD FILEBROWSER.LCOM)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a16">Calling the FileBrowser </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Calling the FileBrowser with the directory calls up the files stored in that directory:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(FB &lt;usr&gt;local&gt;lde&gt;)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Another way to call a FileBrowser is to choose &quot;FileBrowser&quot; from the background</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">menu. You will be prompted for a description of the files to be included (see Figure 5-1). Type an asterisk (*), then press Return to see all the files in the connected directory.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 195pt;text-indent: 0pt;text-align: left;"><span><img width="307" height="206" alt="image" src="Image_037.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 185pt;text-indent: 0pt;text-align: left;">Figure 5-1. Prompt for Files to Include in FileBrowser</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">These show a directory of the device in a window you can leave on the screen at all times. The parts of the FileBrowser window are shown below.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><span><img width="498" height="371" alt="image" src="Image_038.png"/></span></p><p class="s3" style="text-indent: 0pt;text-align: left;">Prompt Window</p><p style="text-indent: 0pt;text-align: left;"/><p class="s11" style="text-indent: 0pt;text-align: left;"> </p><p style="text-indent: 0pt;text-align: left;"/><p class="s3" style="text-indent: 0pt;text-align: left;">Command Menu <u> </u></p><p style="text-indent: 0pt;text-align: left;"/><p class="s11" style="text-indent: 0pt;text-align: left;"> <span class="s3"> File List</span></p><p style="text-indent: 0pt;text-align: left;"/><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 103pt;line-height: 191%;text-align: left;">Figure 5-2. Parts of a FileBrowser Window Now you do not need to continually type the directory command.</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">To use the FileBrowser, choose a file by pointing to the file with the mouse and pressing the left or middle mouse button. A small dark arrow appears to the left of the file</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">name. Choose a command from the menu at the right. In Figure 5-3, the files</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">OCH1.TEDIT;1<span class="p">, </span>OCH10.TEDIT;1<span class="p">, and </span>OCH11.TEDIT;1 <span class="p">have been selected.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 106pt;text-indent: 0pt;text-align: left;">The left mouse button only allows you to choose one file at a time. Even if you choose other files, only the last file you selected with the left mouse button will remain</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">marked as chosen. When you use the middle mouse button to select a file, the file is added to those already chosen.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">To unpick an already chosen file, hold the Control key down while pressing the middle mouse button.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 195pt;text-indent: 0pt;text-align: left;"><span><img width="307" height="174" alt="image" src="Image_039.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 253pt;text-indent: 0pt;text-align: left;">Figure 5-3. Files Chosen</p><ol id="l6"><li><p class="s6" style="padding-top: 3pt;padding-left: 466pt;text-indent: -466pt;text-align: right;">FILEBROWSER</p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_040.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 19pt;text-indent: 0pt;text-align: center;">The next section contains a summary of the FileBrowser commands.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a17">FileBrowser Commands </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 4pt;padding-left: 179pt;text-indent: -54pt;line-height: 107%;text-align: left;">Delete <span class="p">In the FileBrowser, this command marks a file, or files, for deletion (see Figure 5-4). These files are marked by a black line crossing through</span></p><p style="padding-left: 179pt;text-indent: 0pt;line-height: 106%;text-align: left;">them. You may select and mark any number of files for deletion. <span class="s3">Delete </span>does not actually remove these files from the device. The <span class="s3">Expunge </span>command actually wipes out the files previously marked for deletion.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 195pt;text-indent: 0pt;text-align: left;"><span><img width="307" height="177" alt="image" src="Image_041.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 223pt;text-indent: 0pt;text-align: left;">Figure 5-4. Files Marked for Deletion</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 179pt;text-indent: -66pt;line-height: 107%;text-align: left;">Undelete <span class="p">Undoes the delete command for one or more files. Undelete erases the black line through a file marked for deletion.</span></p><p class="s3" style="padding-top: 9pt;padding-left: 137pt;text-indent: 0pt;text-align: left;">Copy <span class="p">This command copies the chosen file. The destination filename should</span></p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">be typed at a prompt that appears in the window above the FileBrowser.</p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">Wildcards do not work for this prompt. You must type the whole</p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">unquoted filename. If more than one file is chosen to be copied, you will be prompted for a directory name. The files will be copied into the</p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">directory you give, but with the same filenames as the ones they have in their original location.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 179pt;text-indent: -54pt;line-height: 107%;text-align: left;">Rename <span class="p">This command works much like the Copy command, but does not leave the original file. The chosen file will be renamed to the destination</span></p><p style="padding-left: 179pt;text-indent: 0pt;line-height: 11pt;text-align: left;">filename. You will be prompted, in the prompt window, for the</p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">destination filename. Give the complete unquoted filename. If more</p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">than one file is chose to be renamed, you will be prompted for a directory name. The files will be moved into the directory you give.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 179pt;text-indent: -66pt;line-height: 107%;text-align: left;">Hardcopy <span class="p">If you do not have a hardcopy device, using this command causes an error. Otherwise, it gives a hardcopy of the file.</span></p><p class="s3" style="padding-top: 9pt;padding-left: 179pt;text-indent: -36pt;line-height: 107%;text-align: left;">See <span class="p">Shows you a file in a window. To use this command, choose a single filename, then the See command. You are prompted for a window.</span></p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">Each time the See command is chosen, a new window is opened to display the file.</p><p class="s3" style="padding-top: 9pt;padding-left: 179pt;text-indent: -42pt;line-height: 107%;text-align: left;">Edit <span class="p">Calls the editor with the file as input. If the file is an executable one (i.e., Lisp code as opposed to a documentation file), only the </span>FILECOMS <span class="p">list is edited. The </span>FILECOMS <span class="p">list is the list of variables, lists, and</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 179pt;text-indent: 0pt;text-align: left;">functions that are contained on that file. FileBrowser loads it and then allows you to edit the <span class="s3">FILECOMS </span>.</p><p class="s3" style="padding-top: 10pt;padding-left: 137pt;text-indent: 0pt;text-align: left;">Load <span class="p">Choose a file with the left mouse button, or a group of files with the</span></p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">middle mouse button. Once the filenames have been blackened, choose the Load command to load them all into Medley.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 179pt;text-indent: -60pt;line-height: 107%;text-align: left;">Compile <span class="p">This command calls the file compiler with the chosen filename(s) as arguments. The compiler compiles a file foun d on a storage device</span></p><p style="padding-left: 179pt;text-indent: 0pt;line-height: 107%;text-align: left;">(<span class="s3">{DSK}</span>), not the functions defined in the Medley image. If any functions on a loaded file have been changed, run the function (<span class="s3">MAKEFILE filename</span>) to write the current version before compiling it. Files do not have to be loaded to use the <span class="s3">Compile </span>command.</p><p class="s3" style="padding-top: 10pt;padding-left: 119pt;text-indent: 0pt;text-align: left;">Expunge <span class="p">This command completely deletes all the marked files from the</span></p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">directory. This allows you to remove unwanted files from your storage device.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Recompute <span class="p">Choose this command when you know that the directory has been</span></p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">changed and should be reread (e.g., after creating new versions of a file).</p></li><li><h1 style="padding-top: 3pt;padding-left: 60pt;text-indent: -25pt;text-align: left;"><a name="bookmark8">THOSE WONDERFUL WINDOWS!</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_042.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 15pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">A window is a designated area on the screen. Every rectangular box on the screen is a window. While Medley supplies many of the windows (such as the Executive Window), you may also create your own. Among other things, you will type, draw pictures, and</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">save portions of your screen with windows.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a18">Windows Provided by Medley </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Two important windows are available as soon as you enter the Medley environment.</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">One is the Executive Window, the main window where you will run your functions. It is the window that the caret is in when you turn on your machine, and load Medley. It is</p><p style="padding-bottom: 2pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">shown in Figure 6-1.</p><p style="padding-left: 196pt;text-indent: 0pt;text-align: left;"><span><img width="240" height="130" alt="image" src="Image_043.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 6-1. Medley Executive Window</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 7pt;padding-bottom: 1pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">The other window that is open when you enter Medley is the &quot;Prompt Window&quot;. It is the long thin black window at the top of the screen. It displays system prompts, or prompts you have associated with your programs. (See Figure 6-2.)</p><p style="padding-left: 170pt;text-indent: 0pt;text-align: left;"><span><img width="311" height="152" alt="image" src="Image_044.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 6-2. Prompt Window</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Other programs, such as the editors, also use windows. These windows appear when</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">the program starts to run, and close (no longer appear on the screen) when the program is done running.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 4pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a19">Creating a Window </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">To create a new window, type: <span class="s9">(CREATEW)</span>. The mouse cursor will change, and have a small square attached to it. (See Figure 6-3.)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 220pt;text-indent: 0pt;text-align: left;"><span><img width="168" height="187" alt="image" src="Image_045.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 171pt;text-indent: 0pt;text-align: left;">Figure 6-3. Mouse Cursor Asking You to Sweep Out Window</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">There may be a prompt in the prompt window to create a window. Press and hold the left mouse button. Move the mouse around, and notice that it sweeps out a rectangle. When the rectangle is the size that youd like your window to be, release the left mouse button. More specific information about the creation of windows, such as giving them</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">titles and specifying their size and position on the screen when they are created, is given in the <span class="s3">WINDOWPROP </span>section of Chapter 12.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a20">Right Button Default Window Menu </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Position the cursor inside the window you just created, and press and hold the right mouse button. A menu of commands should appear (do not release the right button!), like the one in Figure 6-4. To execute one of the commands on this menu, choose the item. Making a choice from a menu is explained in Chapter 3.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 288pt;text-indent: 0pt;text-align: left;"><span><img width="71" height="122" alt="image" src="Image_046.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 202pt;text-indent: 0pt;text-align: left;">Figure 6-4 Right Button Default Window Menu</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">As an example, select &quot;Move&quot; from this menu. The mouse cursor will become a ghost window (ju st an outline of a window, the same size as the one you are moving), with a square attached to one corner, like the one shown in Figure 6-5.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 305pt;text-indent: 0pt;text-align: left;"><span><img width="16" height="16" alt="image" src="Image_047.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 6-5 Mouse Cursor for Moving a Window</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Move the mouse around. The ghost window will follow. Click the left mouse button to place tho window in a new location.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 106pt;text-indent: 0pt;text-align: left;">Choose &quot;Shape&quot;, and notice that you are prompted to sweep out another window. Your original window will have the shape of the window you sketch out.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a21">Explanation of Each Menu Item </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The meaning of each right button default window menu item is explained below:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Close Removes the window from the screen</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 165%;text-align: left;">Snap Copies a portion of the screen into a new window Paint Allows drawing in a window</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 165%;text-align: left;">Clear Clears the window by erasing everything within the window boundaries Bury Puts the window beneath all other windows that overlap it</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Redisplay Redisplays the window contents</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 165%;text-align: left;">Hardcopy Sends the contents of the window to a printer or to a flle Move Allows the wi ndow to be moved to a new spot on the screen Shape Repositions and/or reshapes the window</p><p style="padding-bottom: 2pt;padding-left: 179pt;text-indent: -72pt;text-align: left;">Shrink Reduces the window to a small black rectangle called an icon, or, if appropriate, to the shape for that window type (see Figure 6-6).</p><p style="padding-left: 271pt;text-indent: 0pt;text-align: left;"><span><img width="87" height="95" alt="image" src="Image_048.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 6-6 Example Icon</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 178pt;text-indent: -71pt;text-align: justify;">Expand Changes an icon back to its original window. Position the mouse cursor on the icon, depress the right button, and select Expand. Or, just button the icon with the middle mouse button.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">These right-button default window menu selections are available in most windows, including the Executive Window. When the right button has other functions in a</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">window (as in an editor window), the right button default window menu should be accessible by pressing the Right button in the black border at the top of the window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 4pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a22">Scrollable Windows </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Some windows in Medley are &quot;scrollable&quot;. This means that you can move the contents of the window up and down, or side to side, to see anything that doesnt fit in the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Point the mouse cursor to the left or bottom border of a window. If the window is scrollable, a &quot;scroll bar&quot; will appear. The mouse cursor will change to a double headed arrow. (See Figure 6-7.)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 224pt;text-indent: 0pt;text-align: left;"><span><img width="169" height="196" alt="image" src="Image_049.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 6-7. Scroll Bar of Scrollable Window</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The scroll bar represents the full contents of the window. The example scroll bar is completely white because the window has nothing in it When a part of the scroll bar is shaded, the amount shaded represents the amount of the windows contents currently</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">shown. If everything is showing, the scroll bar will be fully shaded. (See Figure 6-8.)</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">The position of the shading is also important. It represents the relationship of the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">section currently diplayed to the the full contents of the window. For example, if the shaded section is at the bottom of the scroll bar, you are looking at the end of the file.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 197pt;text-indent: 0pt;text-align: left;"><span><img width="242" height="148" alt="image" src="Image_050.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 6-8 Top of File When Shading at Top of Scroll Bar</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">When the scroll bar is visible, you can control the section of the windows contents displayed:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><ul id="l7"><li><p style="padding-left: 119pt;text-indent: -11pt;text-align: left;">To move the contents higher in the window (scroll the contents up in the window), press the leff button of the mouse, the mouse cursor changes to look like this:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 306pt;text-indent: 0pt;text-align: left;"><span><img width="12" height="21" alt="image" src="Image_051.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 6-9. Upward Scrolling Cursor</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">The contents of the window will scroll up, making the line thit the cursor is beside the topmost line in the window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p></li><li><p style="padding-left: 119pt;text-indent: -11pt;text-align: left;">To move the contonts lower in the window (scroll the contents &quot;down&quot; in the window), press the right button of the mouse, and the mouse cursor changes to look like this:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 306pt;text-indent: 0pt;text-align: left;"><span><img width="12" height="21" alt="image" src="Image_052.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 217pt;text-indent: 0pt;text-align: left;">Flgure 6-10. Downward Scrolling Cursor</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">The contents of the window scroll down, moving the line that is the topmost line in the window to beside the curtor.</p></li><li><p style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">To show a specific section of the windows contents, remember that the scroll bar represents the full contents of the window. Move the mouse cursor to the relative</p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">position of the section you want to see (e.g., to the top of the scroll bar if you want to see the top of the windows contents). Press the middle button of the mouse. The mouse cursor will look like this:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 303pt;text-indent: 0pt;text-align: left;"><span><img width="17" height="17" alt="image" src="Image_053.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 213pt;text-indent: 0pt;text-align: left;">Figure 6-11 Proportional Scrolling Cursor</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">When you release the middle mouse button, the windows contents at that relative position will be displayed.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The position of the mouse in the scroll bar defines how much of the window will be scrolled. If it is near the top, then only a little will be scrolled. If it is near the bottom, most of the window will be scrolled.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a23">Other Window Functions </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-top: 4pt;padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a24">PROMPTPRlNT</a></h4><p style="padding-top: 8pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Prints an expression to the black prompt window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">For example, type</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s9" style="padding-left: 107pt;text-indent: 0pt;text-align: left;"><a name="a25">(PROMPTPRINT &quot;THIS WILL BE PRINTED IN THE PROMPT WINDOW&quot;)</a></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">The message will appear in the prompt window. (See Figure 6-12.)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 199pt;text-indent: 0pt;text-align: left;"><span><img width="299" height="101" alt="image" src="Image_054.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 170pt;text-indent: 0pt;text-align: left;"><span><img width="376" height="101" alt="image" src="Image_055.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 241pt;text-indent: 0pt;text-align: left;">Figure 6-12 <span class="s3">PROMPTPRINT</span>ing</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a26">WHlCHW</a></h4><p style="padding-top: 8pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Returns as a value the name of the window that the mouse cursor IS in.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">(WHICHW) <span class="p">can be used as an argument to any function expecting a window, or to</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">reclaim a window that has no name (that is not attached to some particular part of the program.).</p></li></ul></li><li><h1 style="padding-top: 3pt;padding-left: 60pt;text-indent: -25pt;text-align: left;"><a name="bookmark9">EDITING AND SAVING</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_056.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 15pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">This chapter explains how to define functions, how to edit them, and how to save your work.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a27">Defining Functions </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">DEFUN <span class="p">can be used to define new functions. The syntax for it is:</span></p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(DEFUN (&lt;functionname&gt; (&lt;parameter-list&gt;&lt;body-of-function&gt;))</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: justify;">New functions can be created with <span class="s3">DEFUN </span>by typing directly into the Executive Window. Once defined, a function is a part of the Medley environment. For example, the function <span class="s3">EXAMPLE-ADDER </span>is defined in Figure 7-1.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 160pt;text-indent: 0pt;text-align: left;"><span><img width="397" height="126" alt="image" src="Image_057.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 193pt;text-indent: 0pt;text-align: left;">Figure 7-1. Defining the Function <span class="s3">EXAMPLE-ADDER</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Now that the function is defined, it can be called from the Executive Window:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 162pt;text-indent: 0pt;text-align: left;"><span><img width="397" height="126" alt="image" src="Image_058.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 55pt;line-height: 164%;text-align: left;">Figure 7-2.. After <span class="s3">EXAMPLE-ADDER </span>is defined, it can he executed The function returns 6, after printing out the message.</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Functions can also be defined using the editor DEdit described above. To do this, simply type</p><p class="s3" style="padding-top: 7pt;padding-left: 142pt;text-indent: 0pt;text-align: left;"><span class="p">(</span>ED <span class="s4">function-name </span>FUNCTIONS<span class="p">)</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">You will be told that no definition exists for the function, and a menu will pop up asking you what type of function you would like to create:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 163pt;text-indent: 0pt;text-align: left;"><span><img width="394" height="164" alt="image" src="Image_059.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 215pt;text-indent: 0pt;text-align: left;">Figure 7-3 Selecting a Function Template</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Selecting the appropriate type will pop up an editor window with a function template. The use of the editor is explained in the Using the List Structure Editor section below.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a28">Simple Editing in the Executive Window </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">First, type in an example function to edit:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 197pt;text-indent: -54pt;line-height: 88%;text-align: left;">3/41&gt; (defun your-first-function (a b) (if (&gt; a b)</p><p class="s3" style="padding-left: 227pt;text-indent: 0pt;line-height: 88%;text-align: left;">(the first is greater) (the second is greater)))</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To run the function, type:</p><p class="s3" style="padding-top: 8pt;padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">3/42&gt; (YOUR-FIRST-FUNCTION 3 5) (THE SECOND IS GREATER)</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Now, lets alter this. Type:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">3/43&gt; FIX 41</p><p style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Note that your original function is redisplayed, and ready to edit. (See Figure 7-4.)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 166pt;text-indent: 0pt;text-align: left;"><span><img width="386" height="93" alt="image" src="Image_060.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 215pt;text-indent: 0pt;text-align: left;">Figure 7-4. Using FIX to Edit a Fundion</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s10" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Move <span class="p">the text cursor to the appropriate place in the function by positioning the mouse cursor and pressing the left mouse button.</span></p><p class="s10" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Delete <span class="p">text by moving the caret to the beginning of the section to be deleted. Hold the right mouse button down and move the mouse cursor over the text. All of the</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">highlighted text between the caret and mouse cursor is deleted when you release the right mouse button.</p><p class="s10" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">If you make a mistake, <span class="p">deletions can be undone. Press the UNDO key on the keypad to the left of the keyboard.</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Now change <span class="s3">GREATER </span>to <span class="s3">BIGGER</span>:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><ol id="l8"><li><p style="padding-top: 4pt;padding-left: 125pt;text-indent: -18pt;line-height: 107%;text-align: left;">Position the mouse cursor on the <span class="s3">G </span>of <span class="s3">GREATER </span>, and click the left mouse button. The text cursor is now where the mouse cursor is.</p></li><li><p style="padding-top: 6pt;padding-left: 125pt;text-indent: -18pt;text-align: left;">Next, press the right mouse button and hold it down. Notice that if you move the mouse cursor around, it will blacken the characters from the text cursor to the mouse cursor. Move the mouse so that the word &quot;<span class="s3">GREATER </span>&quot; is highlighted.</p></li><li><p style="padding-top: 7pt;padding-left: 125pt;text-indent: -17pt;text-align: left;">Release the right mouse button and <span class="s3">GREATER </span>is deleted.</p></li><li><p style="padding-top: 7pt;padding-left: 125pt;text-indent: -17pt;text-align: left;">Without moving the cursor, type in <span class="s3">BIGGER </span>.</p></li><li><p style="padding-top: 7pt;padding-left: 125pt;text-indent: -18pt;text-align: left;"><span class="s12"> </span>There are two ways to end the editing session and run the function. One is to type Control-<span class="s9">X</span>. (Hold the Control key down, and type <span class="s9">X</span>.) Another is to move the text</p><p style="padding-left: 124pt;text-indent: 0pt;text-align: left;">cursor to the end of the line and crø In both cases, the function has been edited!</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Try the new version of the function by typing:</p><p class="s3" style="padding-top: 8pt;padding-left: 142pt;text-indent: 0pt;line-height: 88%;text-align: left;">3/48&gt; (YOUR-FIRST-FUNCTION 8 9) (THE SECOND IS BIGGER)</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">and get the new result, or you can type:</p><p class="s3" style="padding-top: 7pt;padding-left: 142pt;text-indent: 0pt;line-height: 11pt;text-align: left;">3/49&gt; REDO 42</p><p class="s3" style="padding-left: 142pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(THE SECOND IS BIGGER)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a29">Using the List Structure Editor </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">If the function you want to edit is not readily available (i.e. the function is not in the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Executive Window, and you cant remember the history list number, or you simply have a lot of editing), use the List Structure Editor, often called SEdit. This editor is evoked with a call to <span class="s3">ED</span>:</p><p class="s3" style="padding-top: 6pt;padding-left: 17pt;text-indent: 0pt;text-align: center;">81<span class="s2"></span><span class="p">(</span>ED YOUR-FIRST-FUNCTION FUNCTIONS)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Your function will be displayed in an edit window, as in Figure 7-5.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">If there is no edit window on the screen, you will be prompted to create a window. As</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">before, hold the leff mouse button down, move the mouse until it form s a rectangle of an acceptable size and shape, then release the button. Your function definition will</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">automatically appear in this edit window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 184pt;text-indent: 0pt;text-align: left;"><span><img width="336" height="131" alt="image" src="Image_061.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 246pt;text-indent: 0pt;text-align: left;">Figure 7-5. An Edit Window</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Many changes are easily done with the structure editor. Notice that by pressing the left mouse button you can place the caret in position, and by pressing the middle mouse</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">button you can select atoms or s-expressions. Repeated pressing of the middle button selects bigger pieces of text.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To add an expression that does not appear in the edit window (i.e., it cannot simply be underlined), place the caret at the insertion point and type it in.. For example, to</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">replace the first <span class="s3">GREATER </span>with <span class="s3">LARGER</span>, place the caret to the left of <span class="s3">GREATER </span>, as shown in Figure 7-6.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 184pt;text-indent: 0pt;text-align: left;"><span><img width="336" height="131" alt="image" src="Image_062.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 7-6. Caret Placement Prior to Changing <span class="s3">GREATER </span>with <span class="s3">LARGER</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Now press the DELETE key seven times, and type in <span class="s3">LARGER </span>. The window now looks like this:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 184pt;text-indent: 0pt;text-align: left;"><span><img width="336" height="131" alt="image" src="Image_063.gif"/></span></p><p style="padding-top: 9pt;padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 7-7. <span class="s3">GREATER </span>Changed to <span class="s3">LARGER</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Notice the asterisk in the left edge of the title bar of the window. This designates that the function has be changed. Now exit the edit session by typing Control-X, and the function will be redifined.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a30">Commenting Functions </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Text can be marked as a comment by typing a semi-colon before the text of the comment.</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">; This is the form of a comment</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Inside an editor window, the comment will be printed in a different font and may be moved to the far right of the code. SEdit is familiar with the Common Lisp convention of single comments being on the far right, double comments being justified with the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">function level, and triple comments being on the far left, as is shown in Figure 7-8.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 192pt;text-indent: 0pt;text-align: left;"><span><img width="317" height="146" alt="image" src="Image_064.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 228pt;text-indent: 0pt;text-align: left;">Figure 7-8. Placement of Comments</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">There are other editor commands which can be very useful. To learn about them, read Appendix B of the <i>Release Notes</i>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a31">File Functions and Variables: How to See and Save Them </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">With Medley, all work is done inside the Lisp environment. There is no operating system or command level other than the Executive Window. All functions and data</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">structures are defined and edited using normal Lisp commands. This sertion describes tools in the Medley environment that will keep track of any changes that you make in the environment that you have not yet saved on files, such as defining new functions,</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">changing the values of variables, or adding new variables. And it then has you save the changes in a file you specify. All of these functions are in the <span class="s3">INTERLISP </span>(<span class="s3">IL:</span>) package.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a32">File Variables </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Certain system-defined global variables are used by the file package to keep track of the environment as it stands. You can get system information by checking the values of</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">these variables. Two important variables follow.</p><ul id="l9"><li><p class="s3" style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;line-height: 107%;text-align: left;">FILELST <span class="p">evaluates to a list, all files that yoU have loaded into the Medley environment.</span></p></li><li><p class="s3" style="padding-top: 6pt;padding-left: 119pt;text-indent: -10pt;line-height: 106%;text-align: left;"><span class="s4">filename</span>COMS <span class="p">(Each file loaded into the Lisp environment has associated with it a global variable, whose name is formed by appending </span>COMS <span class="p">to the end of the filename.) This variable evaluates to a list of all the functions, variables, bitmaps, windows, and soon, that are stored on that particular file.</span></p></li></ul><p style="padding-top: 7pt;padding-left: 119pt;text-indent: 0pt;text-align: left;">For example, if you type:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">MYFILECOMS</p><p style="padding-top: 7pt;padding-left: 119pt;text-indent: 0pt;text-align: left;">the system will respond with something like:</p><p class="s3" style="padding-top: 7pt;padding-left: 149pt;text-indent: -6pt;line-height: 106%;text-align: left;">((FNS YOUR-FIRST-FUNCTION ) VARS))</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a33">Saving Interlisp-D on Files </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">The functions <span class="s3">(FILES?) </span>and <span class="s3">(MAKEFILE </span><i>filename</i><span class="s3">) </span>are useful when it is time to save function, variables, windows, bitmaps, records and whatever else to files.</p><p class="s3" style="padding-top: 6pt;padding-left: 179pt;text-indent: -69pt;line-height: 107%;text-align: left;">(FILES?) <span class="p">displays a list of variables that have values and are not already a part of any file, and then the functions that are not already part of any file.</span></p><p style="padding-top: 6pt;padding-left: 179pt;text-indent: 0pt;text-align: left;">Type:</p><p class="s9" style="padding-top: 7pt;padding-left: 203pt;text-indent: 0pt;text-align: left;"><a name="a34">(FILES?)</a></p><p style="padding-top: 7pt;padding-left: 179pt;text-indent: 0pt;text-align: left;">the system will respond with something like:</p><p class="s3" style="padding-top: 7pt;padding-left: 203pt;text-indent: 0pt;line-height: 106%;text-align: left;">the variables: MY.VARIABLE CURRENT.TURTLE...to be dumped</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 5pt;padding-left: 203pt;text-indent: 0pt;line-height: 106%;text-align: left;">the functions: RIGHT LEFT FORWARD BACKWARD CLEAR-SCREEN...to be dumped</p><p class="s3" style="padding-top: 7pt;padding-left: 203pt;text-indent: 0pt;text-align: left;">want to say where the above go?</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">If you type Y, the system will prompt with each item. There are three options:</p><ol id="l10"><li><p style="padding-top: 7pt;padding-left: 197pt;text-indent: -17pt;text-align: left;">To save the item, type the filename (unquoted) of the file where the item should be placed. (This can be a brand new file or an existing file.)</p></li><li><p style="padding-top: 7pt;padding-left: 197pt;text-indent: -17pt;text-align: left;">To skip the item, without removing it from consideration the next</p><p style="padding-left: 197pt;text-indent: 0pt;line-height: 107%;text-align: left;">time <span class="s3">(FILES?) </span>is called, type crø This will allow you to postpone the decision about where to save the item.</p></li><li><p style="padding-top: 6pt;padding-left: 197pt;text-indent: -18pt;text-align: left;">If the item should not be saved at all, type ]. Nowhere will appear after the item.</p><p style="padding-top: 7pt;padding-left: 179pt;text-indent: 0pt;text-align: left;">Part of an example interaction is shown in the following figure:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 128pt;text-indent: 0pt;text-align: left;"><span><img width="487" height="274" alt="image" src="Image_065.gif"/></span></p><p style="padding-top: 6pt;padding-left: 172pt;text-indent: 0pt;text-align: left;">Figure 7-9. Part of an interaction using the function <span class="s3">FILES?</span></p><p class="s3" style="padding-top: 7pt;padding-left: 179pt;text-indent: 0pt;text-align: left;">(FILES?) <span class="p">assembles the items by adding them to the appropriate files</span></p><p class="s3" style="padding-left: 179pt;text-indent: 0pt;line-height: 107%;text-align: left;">COMS <span class="p">variable (see the File Variables section above). </span>(FILES?) <span class="p">does NOT write the file to secondary storage (disks or floppies). It only</span></p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">upclates the global variables discussed in the File Variables section above.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">(MAKEFILE filename)</p><p style="padding-top: 7pt;padding-left: 179pt;text-indent: 0pt;line-height: 165%;text-align: left;">actually writes the file to secondary storage. Type:</p><p class="s9" style="padding-left: 34pt;text-indent: 0pt;line-height: 11pt;text-align: center;"><a name="a35">(MAKEFILE MY.FILE.NAME)</a></p><p style="padding-top: 7pt;padding-left: 179pt;text-indent: 0pt;text-align: left;">and the system will create the file. The function returns the full name of the file created. (i.e. <span class="s3">{DSK}MY.FlLE.NAME.; 1 </span>).</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 179pt;text-indent: 0pt;line-height: 107%;text-align: left;">Files written to <span class="s3">(DSK) </span>are permanent files. They can be removed only by the user deleting them or by reformatting the disk.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Other file manipulation functions can be foun d in Chapter 4.</p></li></ol></li></ol></li><li><h1 style="padding-top: 3pt;padding-left: 60pt;text-indent: -25pt;text-align: left;"><a name="bookmark10">YOUR INIT FILE</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_066.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">Lisp has a number of global variables that control the environment. Global variables make it easy to customize the environment to fit your needs. One way to do this is to</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: justify;">develop an <span class="s3">INIT </span>file. This is a file that is loaded when you start an image. You can use it to set variables, load files, define functions, and any other things that you want to do to make the Medley environment suit you.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a36">Using the USERGREETFILES Variable </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">As described in File Variables section of Chapter 11, each program file has a global Your <span class="s3">INIT </span>file could be called <span class="s3">INIT</span>, <span class="s3">INIT.LISP</span>, <span class="s3">INIT.USER</span>, or whatever the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">convention is at your site. There is no default name preferred by the system, it just</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">looks for the files listed in the variable <span class="s3">USERGREETFILES </span>(see below). Check to see what the preference is at your site. Put this file in your directory. Your directory name should be the same as your login name. The <span class="s3">INIT </span>file is loaded by the function <span class="s3">GREET</span>. <span class="s3">GREET </span>is normally run when Medley is started. If this is not the case at your site, or you want</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">to use the machine and Medley has already been started, you can run the function</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">GREET <span class="p">yourself. If your user name was, for example, </span>TURING <span class="p">, then you would type:</span></p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(GREET TURING)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">This does a number of things, including undoing any previous greeting operation,</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">loading the site init file, and loading your init file. Where <span class="s3">GREET </span>looks for your INIT file depends on the value of the variable <span class="s3">USERGREETFILES</span>. The value of this variable is set when the systems <span class="s3">SYSOUT </span>file is made, so check its value at your site! For example, its value could be:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 197pt;text-indent: 0pt;text-align: left;"><span><img width="236" height="89" alt="image" src="Image_067.gif"/></span></p><p style="padding-top: 9pt;padding-left: 202pt;text-indent: 0pt;text-align: left;">Figure 8-1. Possible Value of <span class="s3">USERGREETFILES</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">In each place you see <span class="s3">&gt;USER&gt;</span>, the argument passed to <span class="s3">GREET </span>is substituted into the path. This is your login name if you are just starting Medley. For example, the first value in the list would have the system check to see whether there was a</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">{DSK}&lt;LISPFlLES&gt;TURING&gt;INIT.LISP <span class="p">file. No error is generated if you do not have an </span>INIT <span class="p">file, and none of the files in </span>USERGREETFILES <span class="p">are foun d.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a37">Making an Init File </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">As described in File Variables section of Chapter 11, each program file has a global</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">variable associated with it, whose name is formed by appending <span class="s3">COMS </span>to the end of the root filename. For any of the standard <span class="s3">INIT </span>file names, the variable <span class="s3">INITCOMS </span>is used. To set up an init file, begin by editing this variable. Type:</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(DV INITCOMS)</p><p class="s7" style="padding-top: 3pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"> 8. YOUR INIT FILE </p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">An SEdit window wiil appear. This window is the same as the one called with the</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">function <span class="s3">DF</span>, and described in the Using the List Structure Editor section in Chapter 7. This chapter assumes that you know how to use the SEdit structure editor .</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">The <span class="s3">COMS </span>variable is a list of lists. The first atom in each internal list specifies for the file package what types of items are in the list, and what it is to do with them. This</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">section will deal with three types of lists: <span class="s3">VARS</span>, <span class="s3">FILES</span>, and <span class="s3">P</span>. Please read about others in Chapter 17 of the <i>IRM</i>.</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">Notice that inside the vars list, there is yet another list. The first item in the list is the name of the variable. It is bound to the value of the second item. There are many other variables that you can set by adding them to the VARS list. Some of these variables are described in Chapter 24, and many others can be foun d in the <i>IRM</i>.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">If you want to automatically load files, that can be done in your init file also. For</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">example, if you always want to load tho Library file <span class="s3">SPY.LCOM </span>, you can load it by editing tho <span class="s3">INITCOMS </span>variable to list the appropriate file in the list starting with <span class="s3">FILES</span>:</p><p style="padding-top: 10pt;text-indent: 0pt;line-height: 11pt;text-align: center;">.</p><p style="text-indent: 0pt;line-height: 10pt;text-align: center;">.</p><p style="text-indent: 0pt;line-height: 11pt;text-align: center;">.</p><p class="s3" style="padding-left: 215pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(FILES SPY)</p><p style="text-indent: 0pt;line-height: 10pt;text-align: center;">.</p><p style="text-indent: 0pt;line-height: 10pt;text-align: center;">.</p><p style="text-indent: 0pt;line-height: 11pt;text-align: center;">.</p><p style="padding-top: 5pt;padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 8-2. <span class="s3">INITCOMS </span>Changed to Load <span class="s3">SPY.LCOM </span>File</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Other files can also be added by simply adding their names to this <span class="s3">FILES </span>list.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Another list that can appear in a <span class="s3">COMS </span>list begins with <span class="s3">P</span>. This list contains Lisp</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">expressions that are evaluated when the file is loaded. Do not put <span class="s3">DEFINEQ </span>expressions in this list. Define the function in the environment, and then save it on the file in the</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">usual way (see Chapter 7).</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">One type of expression you might want to see here, however, is a <span class="s3">FONTCREATE </span>function (see Chapter 16). For example, of you want to use a Helvetica 12 BOLD font, and there is not a font descriptor for it normally in your environment, the appropriate call to <span class="s3">FONTCREATE </span>should be in the &quot;P&quot; list. The <span class="s3">INITCOMS </span>would look like this:</p><p style="text-indent: 0pt;line-height: 11pt;text-align: center;">.</p><p style="text-indent: 0pt;line-height: 10pt;text-align: center;">.</p><p style="text-indent: 0pt;line-height: 10pt;text-align: center;">.</p><p class="s3" style="padding-left: 214pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(FILES SPY)</p><p class="s3" style="padding-left: 214pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(P (FONTCREATE HELVETICA 12 BOLD))</p><p style="text-indent: 0pt;line-height: 10pt;text-align: center;">.</p><p style="text-indent: 0pt;line-height: 10pt;text-align: center;">.</p><p style="text-indent: 0pt;line-height: 11pt;text-align: center;">.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 8-3. <span class="s3">INITCOMS </span>Edited to Include a call to <span class="s3">FONTCREATE</span></p><p style="padding-top: 7pt;padding-left: 106pt;text-indent: 0pt;line-height: 106%;text-align: left;">To quit, exit from SEdit in the usual way. When you run the function <span class="s3">MAKEFILES </span>(see Chapter 7), be sure that you are connected to the directory (see Chapter 4) where the <span class="s3">INIT </span>file should appear. Now when <span class="s3">GREET </span>is run, your Init file will be loaded.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_068.png"/></span></p><p class="s8" style="padding-left: 35pt;text-indent: 0pt;text-align: left;">8-2 <span class="s6">Medley for the Novice, Release 2.0</span></p></li><li><h1 style="padding-top: 3pt;padding-left: 60pt;text-indent: -25pt;text-align: left;"><a name="bookmark11">MEDLEY FORGIVENESS: DWIM</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_069.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 15pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">DWIM <span class="p">(Do What I Mean) is an Interlisp utility that makes life easier.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">DWIM <span class="p">tries to match unrecognized variable and function names to known ones. This allows Lisp to interpret minor typing errors or misspellings in a function, without</span></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">causing a break. Line 152 of Figure 9-1 illustrates how the misspelled <span class="s3">BANNANNA </span>was replaced by <span class="s3">BANANA </span>before the expression was evaluated.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 144pt;text-indent: 0pt;text-align: left;"><span><img width="445" height="193" alt="image" src="Image_070.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 219pt;text-indent: 0pt;text-align: left;">Figure 9-1. Examples of <span class="s3">DWIM </span>Features</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Sometimes <span class="s3">DWIM </span>may alter an expression you didnt want it to. This may occur if, for</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">example, a hyphenated function name (e.g., <span class="s3">(MY-FUNCTION) </span>) is misused. If the system does not recognize the function name, it may think you are trying to subtract &quot;<span class="s3">FUNCTION</span>&quot; from &quot;<span class="s3">MY</span>&quot;. <span class="s3">DWIM </span>also takes the liberty of updating the function, so it will</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">have to be fixed. However, this is as much a blessing as a curse, since it points out the misused expression!</p></li><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark12">BREAKPACKAGE</a></h1></li></ol><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_071.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 15pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">The Break Package is a part of Interlisp that makes debugging your programs much easier.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a38">Break Windows </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">A break is a function either called by the programmer or by the system when an error has occurred. A separate window opens for each break. This window works much like the Executive Window, except for extra menus unique to a break window. Inside a</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">break window, you can examine variables, look at the call stack at the time of the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">break, or call the editor. Each successive break opens a new window, where you can execute functions without disturbing the original system stack. These windows</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">disappear when you resolve the break and return to a higher level.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a39">Break Package Example </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">This example illustrates the basic break package functions. A more complete explanation of the breaking functions, and the break package will follow.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">The correct definition of <span class="s3">FACTORIAL </span>is:</p><p class="s3" style="padding-top: 10pt;padding-left: 173pt;text-indent: -30pt;line-height: 106%;text-align: left;">(defun factorial (x) (if (zerop x)</p><p class="s3" style="padding-left: 203pt;text-indent: 0pt;line-height: 9pt;text-align: left;">1</p><p class="s3" style="padding-left: 197pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(* x (factorial (1- x)))))</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">To demonstrate the break package, we have edited in an error: <span class="s3">DUMMY </span>in the IF statement is an unbound atom, it lacks a value.</p><p class="s3" style="padding-top: 9pt;padding-left: 173pt;text-indent: -30pt;line-height: 106%;text-align: left;">((defun factorial (x) (if (zerop x)</p><p class="s3" style="padding-left: 203pt;text-indent: 0pt;line-height: 9pt;text-align: left;">dummy</p><p class="s3" style="padding-left: 197pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(* x (factorial (1- x)))))</p><p style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The evaluated function</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;text-align: left;">(FACTORIAL 4)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">should return 24, but the above function has an error. <span class="s3">DUMMY </span>is an unbound atom, an atom without an assigned value, so Lisp will &quot;break&quot;. A break window appears (Figure 10-1), that has all the functionality of the typing lisp expressions into the Executive</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Window (The top level), in addition to the break menu functions. Each consecutive break will move to another level &quot;down&quot;.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 158pt;text-indent: 0pt;text-align: left;"><span><img width="403" height="124" alt="image" src="Image_072.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 247pt;text-indent: 0pt;text-align: left;">Figure 10-1. Break Window</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Move the mouse cursor into the break window and hold down the middle mouse button.</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">The Break Menu will appear. Choose BT. Another menu, called the stack menu, will appear beside the break window. Choosing stack items from this menu will display</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">another window. This window displays the functions local variable bindings, or values (see Figure 10-2). This new window, titled FACTORlAL Frame, is an inspector window (see inspector Chapter 17).</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 140pt;text-indent: 0pt;text-align: left;"><span><img width="455" height="230" alt="image" src="Image_073.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 208pt;text-indent: 0pt;text-align: left;">Figure 10-2. Back Trace of the System Stack</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">From the break window, you can call the editor for the function <span class="s3">FACTORIAL </span>by <span class="s3">middle- buttoning on the word FACTORIAL and selecting DisplayEdit from the menu that pops up</span>.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Replace the unbound atom <span class="s3">DUMMY </span>with 1. Exit the editor .</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The function is fixed, and you can restart it from the last call on the stack. (It does not have to be started again from the Top Level.) To begin again from the last call on the stack, choose the last (top) <span class="s3">FACTORIAL </span>call in the BT menu. Select R<span class="s3">EVERT </span>from the middle button break window, or type it into the window. The break window will close, and a new one will appear with the message: <span class="s9">Breakpoint at FACTORIAL</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">To start execution with this last call to <span class="s3">FACTORIAL </span>, choose OK from the middle button break menu. The break window will disappear, and the correct answer, 24, will be</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">returned to the top level.</p><ol id="l11"><li><p class="s6" style="padding-top: 3pt;padding-left: 456pt;text-indent: -456pt;text-align: right;">BREAKPACKAGE</p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_074.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a40">Ways to Stop Execution from the Keyboard (Breaking Lisp) </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">There are ways you can stop execution from the keyboard. They differ in terms of how much of the current operating state is saved:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Control-G Provides you with a menu of processes to interrupt. Your process will</p><p style="padding-left: 179pt;text-indent: 0pt;line-height: 107%;text-align: left;">usually be &quot;<span class="s3">EXEC</span>&quot;. Choose it to break your process. A break window will then appear.</p><p style="padding-top: 9pt;padding-left: 179pt;text-indent: -71pt;text-align: left;">Control-B Causes your function to break, saves the stack, then displays a break window with all the usual break functions. For information on other interrupt characcers, see Chapter 30 in the <i>IRM</i>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a41">Break Menu </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Move the mouse cursor into the break window. Hold the middle button down, and a new menu will pop up, like the one in Figure 10-3.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 286pt;text-indent: 0pt;text-align: left;"><span><img width="69" height="110" alt="image" src="Image_075.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 191pt;text-indent: 0pt;text-align: left;">Figure 10-3. Middle Button Menu in Break window</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Five of the selections are particularly important when just starting to use Medley:</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">BT <span class="p">Back Trace displays the stack in a menu beside the break window. Back</span></p><p style="padding-left: 155pt;text-indent: 0pt;text-align: left;">Trace is a very powerful debugging tool. Each function call is placed on the</p><p style="padding-left: 155pt;text-indent: 0pt;text-align: left;">stack and removed when the execution of that function is complete. Choosing an item on the stack will open another window displaying that items local</p><p style="padding-left: 155pt;text-indent: 0pt;text-align: left;">variables and their bindings. This is an inspector window that offers all the power of the inspector. (For details, see the section on the Inspector, Chapter 17.)</p><p class="s3" style="padding-top: 7pt;padding-left: 155pt;text-indent: -48pt;line-height: 107%;text-align: left;">? = <span class="p">Before you use this menu option, display the stack by choosing BT from this menu, and choose a function from it. Now, choose ?=. It will display the</span></p><p style="padding-left: 155pt;text-indent: 0pt;text-align: left;">current values of the arguments to the function that has been chosen from the stack.</p><p class="s2" style="padding-top: 6pt;padding-left: 155pt;text-indent: -48pt;text-align: left;"><span class="p"> Move back to the previous break window, or if there is no other break window, back to the top level, the Executive Window.</span></p><p class="s3" style="padding-top: 7pt;padding-left: 155pt;text-indent: -48pt;text-align: justify;">REVERT <span class="p">Move the point of execution back to a specified function call before the error. The function to revert back to is, by default, the last function call before the break. If, however, a different function call is chosen on the BT menu, revert will go back to the start of this function and open a new break window. The</span></p><p style="padding-left: 155pt;text-indent: 0pt;text-align: justify;">items on the stack above the new starting place will no longer exist. This is used in the tutorial example (see the Break Package Example section above).</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 4pt;padding-left: 155pt;text-indent: -48pt;line-height: 107%;text-align: left;">OK <span class="p">Continue execution from the point of the break. This is useful if you have a simple error, i.e., an unbound variable or a nonnumeric argument to an</span></p><p style="padding-left: 155pt;text-indent: 0pt;text-align: left;">arithmetic function. Reset the variable in the break window, then select OK. (see the Break Package Example section above).</p><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">In addition to being available on the middle button menu of the break window, all of these functions can be typed directly into the window. Only BT behaves differently</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">when typed. It types the stack into the trace window instead of opening a new window.)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a42">Returning to Top Level </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Typing Control-D will immediately take you to the top level from any break window.</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">The functions called before the break will stop, but any side effect s of the function that occurred before the break remain. For example, if a function set a global variable before it broke, the variable will still be set after typing Control-D.</p></li><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark13">WHAT TO DO IF ...</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_076.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">The purpose of this chapter is to explain what to do in some of the problems commonly experienced by Medley users.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a43">Executive Window turns black</a></h4><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">An example is shown in Figure 11-1.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Press any key to unfreeze the window and continue. This pause happens when the command you just typed causes enough information to be printed to fill the window. It gives you a chance to read that one window of text before moving on.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 180pt;text-indent: 0pt;text-align: left;"><span><img width="347" height="173" alt="image" src="Image_077.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 6pt;padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 11-1. Blackened Executive Window</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a44">You closed the Executive Window</a></h4><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Open another from the Background Menu.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a45">Mouse disappears</a></h4><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Type <span class="s9">(CURSOR T) </span>in the Executive Window. The cursor will reappear.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a46">Second window appears</a></h4><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">This probably happens because you made a typing mistake, as in Figure 11-2.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 211pt;text-indent: 0pt;text-align: left;"><span><img width="269" height="81" alt="image" src="Image_078.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 6pt;padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 11-2. Second Window Appears (Break Window) after Typing Error Made</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Type a Control-D by simultaneously pressing the Control key and the &quot;D&quot;. This aborts the error condition, returning control to the Executive Window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a47">You keep getting beeped at</a></h4><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Usually the beeping means that Medley want input from you. Look for the flashing</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">caret. It will usually be preceeded by some kind of prompt, indicating what you should type.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-top: 4pt;padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a48">You cannot delete the first letter</a></h4><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">of the filename you are typing to <span class="s3">(FILES?) </span>. Type Control-E (error) You will get a linefeed and <span class="s2"></span> printed to the window. Now type the correct filename.</p><h4 style="padding-top: 10pt;padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a49">Your function is just sitting there</a></h4><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">It is not returning a value, and you think that your program may be in an infinite loop or is having some other major problem. You can see what process is currently running by typing Control-T, or you could interrupt the process by typing Control-E.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a50">A Break Window appears</a></h4><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">If the Break Window look something like that shown in Figure 11-3, you are trying to save a file, but there is not enough space on the hard disk.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 161pt;text-indent: 0pt;text-align: left;"><span><img width="400" height="120" alt="image" src="Image_079.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 6pt;padding-left: 149pt;text-indent: 0pt;text-align: left;">Figure 11-3. Break Window Caused by Insufficient Space in Save File</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">Exit from the Break Window by typing an up arrow <span class="s2"></span> followed by a Return. Delete old versions of files, and any other files you do not need. Then try again to save the file</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a51">You have run out of space</a></h4><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Generally, a Break Window has appeared. The <span class="s3">GAINSPACE </span>function allows you to delete non-essential data structures. To use it, type:</p><p class="s9" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;"><a name="a52">(GAINSPACE)</a></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">into the Executive Window. Answer <span class="s3">N </span>to all questions except the following:</p><ul id="l12"><li><p style="padding-top: 7pt;padding-left: 142pt;text-indent: -33pt;text-align: left;">Delete edit history</p></li><li><p style="padding-top: 7pt;padding-left: 142pt;text-indent: -33pt;text-align: left;">Delete history list</p></li><li><p style="padding-top: 7pt;padding-left: 142pt;text-indent: -33pt;text-align: left;">Delete values of old variables</p></li><li><p style="padding-top: 7pt;padding-left: 142pt;text-indent: -33pt;text-align: left;">Delete your <span class="s3">MASTERSCOPE </span>database</p></li><li><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 165%;text-align: left;">Delete information for undoing your greeting. Save your work and reload Lisp as soon as possible.</p><h4 style="padding-top: 3pt;padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a53">A </a><span class="s9">redefined </span>message appears</h4><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;"><span class="p">The message </span>(<span class="s4">Some.Crucial.Function.Or.Variable </span>redefined) <span class="p">appears in the</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Executive Window (see Figure 11-4). The function, variable, or other property has been &quot;smashed&quot; (i.e., its original definition has been changed). If this is not what you</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">wanted, type <span class="s9">UNDO </span>immediately!</p><ol id="l13"><li><p class="s6" style="padding-top: 3pt;padding-left: 455pt;text-indent: -455pt;text-align: right;">WHAT TO DO IF...</p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_080.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 202pt;text-indent: 0pt;text-align: left;"><span><img width="289" height="168" alt="image" src="Image_081.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 238pt;text-indent: 0pt;text-align: left;">Figure 11-4. <span class="s3">CAR redefined!</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a54">UNBOUND ATOM</a></h4><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">If this occurs, you probably just typed something wrong, or you passed an argument that should have been quoted to a function.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a55">UNDEFINED CAR OF FORM</a></h4><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: justify;">First, look at what caused the error. If the <span class="s3">CAR </span>of the form is a list, then you typed something wrong. If it is an atom, then perhaps that atom does not have a function associated with it. If it is a CLISP word like <span class="s3">if </span>or <span class="s3">for</span>, then <span class="s3">DWIM </span>may have been</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">turned off (see Chapter 9). Type <span class="s9">(DWIM C) </span>to reenable DWIM.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a56">You have traced APPLY</a></h4><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">and your screen is spewing out information about everything going on in the</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">environment. Type Control E, and type <span class="s9">(UNBREAK APPLY) </span>before reeturning to the Executive.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 209pt;text-indent: 0pt;text-align: left;">[This page intentionally left blank]</p></li><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark14">WINDOWS AND REGIONS</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_082.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 14pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a57">Windows </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Windows have two basic parts: an area on the screen containing a collection of pixels,</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">and a property list. The window properties determine how the window looks, the menus that can be accessed from it, what should happen when the mouse is inside the window and a mouse button is pressed, and soon.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a58">CREATEW</a></h3><p style="padding-top: 8pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Some of the windows properties can be specified when a window is created with the function <span class="s3">CREATE</span>W. In particular, it is easy to specify the size and position of the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">window; its title; and the width of its borders.</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(CREATEW <span class="s4">region title borderwidth</span>)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 106pt;text-indent: 0pt;line-height: 106%;text-align: left;">Region is a record (named <span class="s3">REGION </span>, with the fields <span class="s3">left</span>, <span class="s3">bottom </span>, <span class="s3">width</span>, and <span class="s3">height) </span>or a list. A region describes a rectangular area on the screen, the windows dimensions and position. The fields left and bottom refer to the position of the bottom leff corner of</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">the region on the screen. Wi dth and height refer to the width and height of the region. The usable space inside the window will be smaller than the width and height, because some of the windows region is consumed by the title bar, and some is taken by the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">borders.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">Title is a string that will be placed in the title bar of the window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">Borderwidth is the width of the border around the exterior of the window, in number of pixels.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">For example, typing:</p><p class="s3" style="padding-top: 7pt;padding-left: 173pt;text-indent: -30pt;text-align: left;">(SETQ MY.WINDOW (CREATEW (CREATEREGION l00 150 300 200) &quot;THIS IS MY OWN WINDOW&quot;)</p><p style="padding-top: 9pt;padding-left: 106pt;text-indent: 0pt;text-align: left;">or</p><p class="s3" style="padding-top: 7pt;padding-left: 142pt;text-indent: 0pt;text-align: left;">(SETQ MY.WINDOW (CREATEW</p><p class="s3" style="padding-top: 1pt;padding-left: 173pt;text-indent: 6pt;line-height: 88%;text-align: left;">(CREATEW (100 150 300 200) &quot;THIS IS MY OWN WINDOW&quot;)</p><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">produces a window with a default borderwidth. Note that you did not need to specify all the windows properties (see Figure 12-1).</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 114pt;text-indent: 0pt;text-align: left;"><span><img width="460" height="337" alt="image" src="Image_083.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 237pt;text-indent: 0pt;text-align: left;">Figure 12-1. Creating a Window</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">In fact, if <span class="s3">(CREATEW) </span>is called without specifying a region, you will be prompted to sweep out a region for the window (see Chapter 10)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a59">WlNDOWPROP</a></h3><p style="padding-top: 8pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The function to access or add to any property of a windows property list is</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">WINDOWPROP<span class="p">.</span></p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(WINDOWPROP <span class="s4">window property </span><span class="p">&lt;value&gt;</span>)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">When you use <span class="s3">WINDOWPROP </span>with only two arguments—window and property—it</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">returns the value of the windows property. When you use <span class="s3">WINDOWPROP </span>with all three</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">arguments—window, property and value—it sets the value the windows property to the value you inserted for the third argument.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">For example, consider the window, <span class="s3">MY WINDOW </span>, created using <span class="s3">(CREATEW)</span>. <span class="s3">TITLE </span>and</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">REGION <span class="p">are both properties. Type</span></p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(WINDOWPROP MY.WINDOW TITLE)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">and the value of <span class="s3">MY.WlNDOW</span>s <span class="s3">TITLE </span>property is returned, <span class="s3">&quot;THIS 1S MY OWN WINDOW&quot;</span>. To change the title, use the <span class="s3">WINDOWPROP </span>function, and give it the window, the property title, and the new title of the window.</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(WINDOWPROP MY.WINDOW TITLE &quot;MY FIRST WINDOW&quot;)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">automatically changes the title and automatically updates the window. Now the window looks like Figure 12-2.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 116pt;text-indent: 0pt;text-align: left;"><span><img width="456" height="342" alt="image" src="Image_084.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 215pt;text-indent: 0pt;text-align: left;">Figure 12-2. <span class="s3">TITLE </span>is a Window Property</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Altering the region of the window, <span class="s3">MY.WINDOW</span>, is also be done with <span class="s3">WINDOWPROP</span>, in the same way you changed the title. (Changing either of the first two numbers of a region</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">changes the position of the window on the screen. Changing either of the last two numbers changes the dimensions of the window itself.)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a60">Getting Windows to Do Things</a></h3><p style="padding-top: 8pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Four basic window properties will be discussed here: <span class="s3">CURSORINFN </span>, <span class="s3">CURSOROUTFN</span>, <span class="s3">CURSORMOVEDFN</span>, and <span class="s3">BUTTONEVENTFN</span>.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">A function can be stored as the value of the <span class="s3">CURSORlNFN </span>property of a window. It is called when the mouse cursor is moved into that window.</p><p style="padding-top: 6pt;padding-left: 48pt;text-indent: 0pt;text-align: center;">Look at the following example:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><ol id="l14"><li><p style="padding-left: 118pt;text-indent: -11pt;text-align: left;">First, create a window called <span class="s3">MY.WINDOW</span>. Type:</p><p class="s3" style="padding-top: 7pt;padding-left: 125pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(SETQ MY.WINDQW</p><p class="s3" style="padding-left: 155pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(CREATEW</p><p class="s3" style="padding-left: 172pt;text-indent: 0pt;line-height: 88%;text-align: left;">(CREATEREGION 200 200 200 200) &quot;THIS WINDOW WILL SCREAM!&quot;))</p><p style="padding-top: 6pt;padding-left: 49pt;text-indent: 0pt;text-align: center;">This creates a window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p></li><li><p style="padding-left: 125pt;text-indent: -17pt;line-height: 107%;text-align: left;">Now define the function <span class="s3">SCREAME </span>R. It will be stored on the property <span class="s3">CURSOR1NFN </span>. (Notice that this function has one argument, <span class="s3">WlNDOWNAM </span>E. All functions called from the property <span class="s3">CURSOR1NFN </span>are passed the window it was called from. So the value of <span class="s3">MY.WINDOW </span>is bound to <span class="s3">WINDOWNAME</span>. When it is called, <span class="s3">SCREAME</span>R simply rings</p><p style="padding-left: 125pt;text-indent: 0pt;text-align: left;">bells.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 6pt;padding-left: 142pt;text-indent: -18pt;line-height: 88%;text-align: left;">(DEFINEQ (SCREAMER (WINDOWNAME) (RINGBELLS)</p><p class="s3" style="padding-left: 142pt;text-indent: 0pt;line-height: 88%;text-align: left;">(PROMPTPRINT &quot;YAY - IT WORKS!&quot;) (RINGBELLS)))</p><p style="text-indent: 0pt;text-align: left;"><br/></p></li><li><p style="padding-left: 125pt;text-indent: -17pt;line-height: 107%;text-align: left;">Now, alter that windows <span class="s3">CURSORINFN </span>property, so that the system calls the function <span class="s3">SCREAMER </span>at the appropriate time. Type:</p><p class="s3" style="padding-top: 7pt;padding-left: 155pt;text-indent: -30pt;line-height: 88%;text-align: left;">(WINDOWPROP MY.WINDOW CURSORINFN (FUNCTION SCREAMER))</p></li><li><p style="padding-top: 6pt;padding-left: 124pt;text-indent: -17pt;text-align: left;">After this, when you move the mouse cursor into <span class="s3">MY.WlNDOW </span>, the <span class="s3">CURSORINFN</span></p><p style="padding-left: 125pt;text-indent: 0pt;text-align: left;">propertys function is called, and it rings bells twice.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">CURSORINFN <span class="p">is one of the many window properties that come with each window - just as </span>REGION <span class="p">and </span>TITLE <span class="p">did. Other properties include:</span></p><p class="s3" style="padding-top: 7pt;padding-left: 203pt;text-indent: -96pt;line-height: 107%;text-align: left;">CURSOROUTFN <span class="p">The function that is the value of this property is executed when the cursor is moved out of a window.</span></p><p class="s3" style="padding-top: 6pt;padding-left: 203pt;text-indent: -96pt;line-height: 107%;text-align: left;">CURSORMOVEDFN <span class="p">The function that is the value of this property is executed when the cursor is moved while it is inside the window.</span></p><p class="s3" style="padding-top: 6pt;padding-left: 203pt;text-indent: -96pt;line-height: 107%;text-align: left;">BUTTONEVENTFN <span class="p">The function that is the value of this property is executed when either the left or middle mouse buttons are pressed (or released).</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Figure 12-3 shows <span class="s3">MY.WlNDOW</span>s properties. Notice that the <span class="s3">CURSORINFN </span>has the</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">function <span class="s3">SCREAMER </span>stored in it. The properties were shown in this window using the function <span class="s3">INSPECT</span>. <span class="s3">INSPECT </span>is covered in Chapter 17.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 136pt;text-indent: 0pt;text-align: left;"><span><img width="400" height="382" alt="image" src="Image_085.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 140pt;text-indent: 0pt;text-align: left;">Figure 12-3. Inspecting <span class="s3">MY.WINDOW </span>for Mouse-Related Window Properties</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">You can define functions for the values of the properties <span class="s3">CURSOROUTFN </span>and <span class="s3">CURSORMOVEDFN </span>in much the same way as you did for <span class="s3">CURSORINFN</span>. The function that is the value of the property <span class="s3">BUTTONEVENTF </span>N, however, can be specialized to respond in different ways, depending on which mouse button is pressed. This is explained in the</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">next section.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a61">BUTTONEVENTFN</a></h3><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">BUTTONEVENTFN <span class="p">is another property of a window. The function that is stored as the value of this property is called when tho mouse is inside the window, and a mouse button is pressed. As an example of how to use it, type:</span></p><p class="s3" style="padding-top: 7pt;padding-left: 173pt;text-indent: -30pt;line-height: 88%;text-align: left;">(WINDOWPROP MY.WINDOW BUTTONEVENTFN (FUNCTION SCREAMER))</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">When the mouse cursor is moved into the window, bells will ring because of the <span class="s3">CURS0RlNFN</span>, but it will also ring bells when either the left or middle mouse button is pressed. Notice that the right mouse button functions as it usually does, with the</p><p style="padding-left: 106pt;text-indent: 0pt;line-height: 106%;text-align: left;">window manipulation menu. If only the left button should evoke the function <span class="s3">SCREAMER</span>, then the function can be written to do just this, using the function <span class="s3">MOUSESTATE</span>, and a form that only <span class="s3">MOUSESTATE </span>understands, <span class="s3">ONLY</span>. For example:</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(DEFINEQ</p><p class="s3" style="padding-left: 173pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(SCREAMER2 (WINDOWNAME)</p><p class="s3" style="padding-left: 233pt;text-indent: -30pt;line-height: 88%;text-align: left;">(if (MOUSESTATE (ONLY LEFT)) then (RINGBELLS))))</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">In addition to <span class="s3">(ONLY LEFT)</span>, <span class="s3">MOUSESTATE </span>can also be passed <span class="s3">(ONLY MIDDLE) </span>, <span class="s3">(ONLY RIGHT) </span>or combinations of these (e.g. <span class="s3">(OR (ONLY LEFT) (ONLY MIDDLE))</span>). You do not need to use <span class="s3">ONLY </span>with <span class="s3">MOUSESTATE </span>for every application. <span class="s3">ONLY </span>means that that</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">button is pressed and no other.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">If you do write a function using <span class="s3">(ONLY RIGHT)</span>, be sure that your function also checks position of the mouse cursor. Even if you want your function to be executed when the mouse cursor is inside the window and the right button is pressed, there is a convention that the function <span class="s3">DOWINDOWCOM </span>should be executed when the mouse cursor is in the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">title bar or the border of the window and the right mouse button is pressed. Please</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">program your windows using this tradition! For more information, please see Chapter 28 in the <i>IRM</i>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a62">Looking at a Windows Properties</a></h3><p style="padding-top: 8pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">I<span class="s3">NSPECT </span>is a function that displays a list of the properties of a window, and their values. Figure 12.3 shows the <span class="s3">INSPECT </span>function run with <span class="s3">MY.WINDOW </span>. Note the</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">properties introduced in <span class="s3">CREATEW </span>: <span class="s3">WBORDER </span>is the windows border, <span class="s3">REG </span>is the region, and <span class="s3">WTITLE </span>is the windows title.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a63">Regions </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">A region is a record, with the fields <span class="s3">LEFT</span>, <span class="s3">BOTTOM </span>, <span class="s3">WIDTH</span>, and <span class="s3">HEIGHT</span>. <span class="s3">LEFT </span>and <span class="s3">BOTTOM </span>refer to where the bottom left hand corner of the region is positioned on the screen. <span class="s3">WIDTH </span>and <span class="s3">HEIGHT </span>refer to the width and height of the region.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">CREATEREGION <span class="p">creates an instance of a record of type </span>REGION <span class="p">. Type:</span></p><p class="s3" style="padding-top: 7pt;padding-left: 57pt;text-indent: 0pt;text-align: center;">(SETQ MY.REGION (CREATEREGION 15 l00 200 450))</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">to create a record of type <span class="s3">REGION </span>that denotes a rectangle 200 pixels high, and 450 pixels wide, whose bottom left corner is at position (15, 100). This record instance can be passed to any function that requires a region as an argument, such as <span class="s3">CREATEW </span>, above.</p></li></ol></li><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark15">WHAT ARE MENUS?</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_086.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">While Medley provides a number of menus of its own (see Chapter 3), this section</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">addresses the menus you wish to create. You will learn how to create a menu, display a menu, and define functions that make your menu useful. Menus are instances of</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">records (see Chapter 24). There are 27 fields that determine the composition of every menu. Because Medley provides default values for most of these descriptive fields, you need to familiarize yourself with only a few that we describe in this section.</p><p style="padding-top: 7pt;padding-bottom: 2pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Two of these fields, the <span class="s3">TITLE </span>of your menu, and the <span class="s3">ITEMS </span>you wish it to contain, can be typed into the executive window as shown below:</p><p style="padding-left: 191pt;text-indent: 0pt;text-align: left;"><span><img width="318" height="143" alt="image" src="Image_087.gif"/></span></p><p style="padding-top: 9pt;padding-left: 243pt;text-indent: 0pt;text-align: left;">Figure 13-1. Creating a menu</p><p style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Note that creating a menu does not display it. <span class="s3">MY.MENU </span>is set to an instance of a menu record that specifies how the menu will look, but the menu is not displayed.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a64">Displaying Menus </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Typing either the <span class="s3">MENU </span>or <span class="s3">ADDNENU </span>functions will display your menu on the screen. <span class="s3">MENU </span>implements pop-up menus, like the Background Menu or the Window Menu. <span class="s3">ADDMENU </span>puts menus into a semi-permanent window on the screen, and lets you select items from it.</p><p class="s3" style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;line-height: 164%;text-align: left;">(MENU MENU POSITION) <span class="p">pops up a menu at a particular position on the screen. Type:</span></p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;text-align: left;">(MENU MY.MENU NIL)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">to position the menu at the end of the mouse cursor. Note that the <span class="s3">POSITION </span>argument is <span class="s3">NIL</span>. In order to go on, you must either choose an item, or move outside the menu</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">window and press a mouse button. When you do either, the menu will disappear. If you choose an item, then want to choose another, the menu must be redisplayed.</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">(ADDMENU <span class="s4">menu window position</span>) <span class="p">positions a permanent menu on the screen, or in an existing window.</span></p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Type:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(ADDMENU MY.MENU)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">to display the menu as shown in Figure 13-2. This menu will remain active, (will stay on the screen) without stopping all the other processes. Because <span class="s3">ADDMENU </span>can display a menu without stopping all other processes, it is very popular in users programs.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">If window is specified, the menu is displayed in that window. If window is not specified, a window the correct size for the menu is created, and the menu is displayed in that</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">window.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">If position is not specified, the menu appears at the current position of the mouse cursor.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 221pt;text-indent: 0pt;text-align: left;"><span><img width="238" height="62" alt="image" src="Image_088.gif"/></span></p><p style="padding-top: 5pt;padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 13-2. Simple MenuDisplayed with <span class="s3">ADDMENU</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a65">Getting Menus to Do Stuff </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">One way to make a menu do things is to specify more about the menu items. Instead of items simply being the strings or atoms that will appear in the menu, items can be lists, each list with three elements (see Figure 13-3). The first element of each list is what</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">will appear in the menu; the second expression is what is evaluated, and the results of the evaluation returned, when the item is selected; and the third expression is the</p><p style="padding-bottom: 1pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">expression that should be printed in the Prompt window when a mouse button is held down while the mouse is pointing to that menu item. This third item should be thought of as help text for the user. If the third element of the list is NIL, the system responds with <b>Will select this item w hen you release the button</b>.</p><p style="padding-left: 148pt;text-indent: 0pt;text-align: left;"><span><img width="435" height="416" alt="image" src="Image_089.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 13-3. Creating a Menu to do Things, then displaying it with the function</p><p class="s3" style="padding-left: 111pt;text-indent: 0pt;text-align: center;">ADDMENU</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Now when an item is selected from <span class="s3">MY.MENU2</span>, something will happen. When a mouse button is held down, the expression typed as the third element in the items</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">specification will be printed in the Prompt window. (See Figure 13-4.)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;"><span><img width="552" height="111" alt="image" src="Image_090.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 13-4. Mouse Button Held Down While Mouse Cursor SeIects <span class="s3">NEXT.QUESTION</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-bottom: 1pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">When the mouse button is released (i.e., the item is selected) the expression that was typed as the second element of the items specification will be run. (See Figure 13-5.)</p><p style="padding-left: 174pt;text-indent: 0pt;text-align: left;"><span><img width="364" height="156" alt="image" src="Image_091.gif"/></span></p><p style="padding-top: 5pt;padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 13-5. <span class="s3">NEXT-QUESTION </span>Selected</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 8pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a66">WHENHELDFN and WHENSELECTEDFN Fields of a Menu </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Another way to get a menu to do things is to define functions, and make them the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">values of the menus <span class="s3">WHENHELDFN </span>and <span class="s3">WHENSELECTEDFN </span>fields. As the value of the</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">WHENHELDFN <span class="p">field of a menu, the function you defined will be executed when you press</span></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">and hold a mouse button inside the menu. As the value of the <span class="s3">WHENSELECTEDFN </span>field of a menu, the function you defined will be executed when you choose a menu item. This</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">example has the same functionality as the previous example, where each menu item was entered as a list of three items.</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">As an example, type in these two functions so that they can be executed when the menu is created and displayed:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(DEFINEQ (MY.MENU3.WHENHELD (ITEM.SELECTED MENU.FROM BUTTON.PRESSED)</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(SELECTQ ITEM.SELECTED</p><p class="s3" style="padding-left: 179pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(QUIT (PROMPTPRINT &quot;CHOOSE THIS TO STOP&quot;)</p><p class="s3" style="padding-left: 215pt;text-indent: -36pt;line-height: 88%;text-align: left;">(NEXT-QUESTION (PROMPTPRINT &quot;CHOOSE THIS TO BE ASKED THE NEXT QUESTION&quot;))</p><p class="s3" style="padding-left: 215pt;text-indent: -36pt;line-height: 88%;text-align: left;">(NEXT-TOPIC (PROMPTPRINT &quot;CHOOSE THIS TO MOVE ON TO THE NEXT SUBJECT&quot;))</p><p class="s3" style="padding-left: 215pt;text-indent: -36pt;line-height: 88%;text-align: left;">(SEE-TOPICS (PROMPTPRINT &quot;CHOOSE THIS TO SEE THE TOPICS NOT YET LEARNED&quot;))</p><p class="s3" style="padding-left: 179pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(ERROR (PROMPTPRINT &quot;NO MATCH FOUND&quot;))))</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(DEFINEQ (MY.MENU3.WHENSELECTED (ITEM.SELECTED MENU.FROM BUTTON.PRESSED)</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(SELECTQ ITEM.SELECTED</p><p class="s3" style="padding-left: 179pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(QUIT (PRINT &quot;STOPPED&quot;)</p><p class="s3" style="padding-left: 179pt;text-indent: 0pt;line-height: 88%;text-align: left;">(NEXT-QUESTION (PRINT &quot;HERE IS THE NEXT QUESTION&quot;)) (NEXT-TOPIC (PRINT &quot;HERE IS THE NEXT SUBJECT&quot;)) (SEE-TOPICS (PRINT &quot;THE FOLLOWING HAVE NOT BEEN</p><p class="s3" style="padding-left: 215pt;text-indent: 0pt;line-height: 10pt;text-align: left;">LEARNED . . .&quot;))</p><p class="s3" style="padding-left: 179pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(ERROR (PROMPTPRINT &quot;NO MATCH FOUND&quot;))))</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Now, to create the menu, type:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(SETQ MY.MENU3 (CREATE MENU</p><p class="s3" style="padding-left: 167pt;text-indent: 0pt;line-height: 11pt;text-align: left;">TITLE <span class="s2"></span><span class="p"> </span>&quot;PLEASE CHOOSE ONE OF THE ITEMS&quot;</p><p class="s3" style="padding-left: 167pt;text-indent: 0pt;line-height: 86%;text-align: left;">ITEMS <span class="s2"></span><span class="p"> </span>(QUIT NEXT-QUESTION NEXT-TOPIC SEE-TOPICS) WHENHELDFN <span class="s2"></span><span class="p"> </span>(FUNCTION MY.MENU3.WHENHELD) WHENSELECTEDFN <span class="s2"></span><span class="p"> </span>(FUNCTION MY.MENU3.WHENSELECTED)))</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To see your menu work, type</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(ADDMENU MY.MENU3)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Now, due to executing the <span class="s3">WHENHELDFN </span>function, holding down any mouse button while pointing to a menu item will display an explanation of the item in the prompt window.</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">The screen will once again look like Figure 13-4 when the mouse button is held when the mouse cursor is pointing to the item <span class="s3">NEXT-TOPIC </span>.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: justify;">Now due to executing the <span class="s3">WHENSELECTEDFN </span>function, releasing the mouse button to select an item will cause the proper actions for that item to be taken. The screen will once again look like Figure 13-5 when the item <span class="s3">NEXT-TOPIC </span>is selected. The crucial</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">thing to note is that the functions you defined for <span class="s3">WHENHELDFN </span>and <span class="s3">WHENSELECTEDFN</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">are automatically given the following arguments:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><ol id="l15"><li><p style="padding-left: 125pt;text-indent: -17pt;text-align: left;">The item that was sølected, <span class="s3">ITEM.SELECTED</span></p></li><li><p style="padding-top: 7pt;padding-left: 125pt;text-indent: -17pt;text-align: left;">The menu it was selected from, <span class="s3">MENU.FROM</span></p></li><li><p style="padding-top: 7pt;padding-left: 125pt;text-indent: -17pt;text-align: left;">The mousø button that was pressed <span class="s3">BUTTON PRESSED</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">These functions, <span class="s3">MY.MENU3.WHENHELD </span>and <span class="s3">MY.MENU3.WHENSELECTED</span>, were quoted</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">using <span class="s3">FUNCTION </span>instead of <span class="s3">QUOTE </span>both for program readability and so that the compiler can produce faster code when the program is compiled. It is good style to quote</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 12pt;text-align: justify;">functions in Lisp by using the function <span class="s3">FUNCTION </span>instead of <span class="s3">QUOTE</span>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 4pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a67">Looking at a Menus Fields </a></h2><p class="s3" style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">INSPECT <span class="p">is a function that displays a list of the fields of a menu, and their values. Figure 13-6 shows the various fields of </span>MY.MENU3 <span class="p">when the function </span>(INSPECT</p><p class="s3" style="padding-bottom: 1pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">MY.MENU3) <span class="p">was called. Notice the values that were assigned by the examples, and all the defaults.</span></p><p style="padding-left: 125pt;text-indent: 0pt;text-align: left;"><span><img width="496" height="437" alt="image" src="Image_092.gif"/></span></p><p style="padding-top: 4pt;padding-left: 242pt;text-indent: 0pt;text-align: left;">Figure 13-6. <span class="s3">MY.MENU3 </span>Fields</p></li></ol></li><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark16">BITMAPS</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_093.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">A bitmap is a rectangular array of dots. The dots are called &quot;pixels&quot; (for picture</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">elements). Each dot, or pixel, is represented by a single bit. When a pixel or bit is turned on (i.e. that bit set to 1), a black dot is inserted into a bitmap. If you have a bitmap of a floppy on your screen (Figure 14-1), then all of the bits in the area that make up the floppy are turned on, and the surrounding bits are turned off.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 198pt;text-indent: 0pt;text-align: left;"><span><img width="303" height="281" alt="image" src="Image_094.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 237pt;text-indent: 0pt;text-align: left;">Figure 14-1. Bitmap of a Floppy</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 106pt;text-indent: 0pt;text-align: left;">BITMAPCREATE <span class="p">creates a bitmap, even though it cant be seen.</span></p><p class="s3" style="padding-top: 7pt;padding-left: 142pt;text-indent: 0pt;text-align: left;">(BITMAPCREATE <span class="s4">width height</span>)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">If the width and height are not supplied, the system will prompt you for them.</p><p class="s3" style="padding-top: 7pt;padding-left: 106pt;text-indent: 0pt;text-align: left;">EDITBM <span class="p">edits the bitmap. The syntax of the function is:</span></p><p class="s3" style="padding-top: 7pt;padding-left: 142pt;text-indent: 0pt;text-align: left;">(EDITBM <span class="s4">bitmapname</span>)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Try the following to produce the results in Figure 14-4:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 106%;text-align: left;">(SETQ MY.BITMAP (BITMAPCREATE 60 40)) EDITBM MY.BITMAP)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s10" style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">To dra w <span class="p">In the bitmap, move the mouse into the gridded section of the bitmap editor, and press and hold the leff mouse button. Move the mouse around to turn on the bits</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">represented by the spaces in the grid. Notice that each space in the grid represents one pixel on the bitmap</p><p class="s10" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">To erase <span class="p">Move the mouse into the gridded section of the bitmap editor, and press and hold the center mouse button. Move the mouse around to turn off the bits represented by the spaces in the gridded section of the bitmap editor.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s10" style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To w ork on a different section <span class="p">Point with the mouse cursor to the picture of the</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">actual bitmap (the upper left corner of the bitmap editor). Press and hold the left mouse button. A menu with the single item, Move will appear. (See Figure 14-2.) Choose this</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">item.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 139pt;text-indent: 0pt;text-align: left;"><span><img width="457" height="360" alt="image" src="Image_095.gif"/></span></p><p style="padding-top: 7pt;padding-left: 211pt;text-indent: 0pt;text-align: left;">Figure 14-2. Menu with Single Item (Move)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">You will be asked to position a ghost window over the bitmap. This ghost window</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">represents the portion of the bitmap that you are currently editing. Place it over the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">section of the bitmap that you wish to edit and click the left mouse button (see Figure 14-3).</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 218pt;text-indent: 0pt;text-align: left;"><span><img width="258" height="270" alt="image" src="Image_096.gif"/></span></p><p style="padding-top: 7pt;padding-left: 195pt;text-indent: 0pt;text-align: left;">Figure 14-3. Ghost Window Awaiting Positioning</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s10" style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To end the session, <span class="p">bring the mouse cursor into the upper-right portion of the window (the grey area) and press the center button. Select OK from the menu to save your</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">artwork.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 197pt;text-indent: 0pt;text-align: left;"><span><img width="305" height="271" alt="image" src="Image_097.gif"/></span></p><p style="padding-top: 6pt;padding-left: 241pt;text-indent: 0pt;text-align: left;">Figure 14-4. Editing a Bitmap</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">BITBLT <span class="p">is the primitive function for moving bits (or pixels) from one bitmap to another.</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">It extracts bits from the source bitmap, and combines them in appropriate ways with those of the destination bitmap. The syntax of the function is:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(BITBLT sourcebitmap sourcelefl sourcebottom destinationbitmap destinationleft destinationbottom width height sourcetype operation texture clippIngregion)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Heres how its done —using <span class="s3">MY.BITMAP </span>as the sourcebitmap and <span class="s3">MY.WlNDOW </span>as the destinationbitmap.</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(BITBLT MY.BITMAP NIL NIL</p><p class="s3" style="padding-left: 191pt;text-indent: 0pt;line-height: 11pt;text-align: left;">MY.WINDOW NIL NIL NIL NIL INPUT REPLACE)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Note that the destination bitmap can be, and usually is, a window. Actually, it is the bitmap of a window, but the system handles that detail for you. Because of the <span class="s3">NIL</span>s</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">(meaning &quot;use the default&quot;), <span class="s3">MY.BITMAP </span>will be <span class="s3">BITBLT</span>d into the lower right corner of</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">MY.WlNDOW <span class="p">(see Figure 14-5).</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 161pt;text-indent: 0pt;text-align: left;"><span><img width="399" height="427" alt="image" src="Image_098.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 90pt;line-height: 245%;text-align: left;">Figure 14-5. <span class="s3">BITBLT </span>ing a Bitmap onto a Window Here is what each of the <span class="s3">BITBLT </span>arguments to the function mean:</p><p class="s3" style="padding-top: 2pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">sourcebitmap <span class="p">The bitmap to be moved into the destinationbitmap</span></p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">sourceleft <span class="p">A number, starting at 0 for the left edge of the</span></p><p style="padding-left: 239pt;text-indent: 0pt;text-align: left;">sourcebitmap, that tells <span class="s3">BITBLT </span>where to start moving pixels from the sourcebitmap. For example, if the leftmost 10 pixels of sourcebitmap were not to be moved, sourceleft should be 10. The default value is 0.</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">sourcebottom <span class="p">A number, starting at 0 for the bottom edge of the</span></p><p style="padding-left: 239pt;text-indent: 0pt;text-align: left;">sourcebitmap, that tells <span class="s3">BITBLT </span>where to start moving pixels from the sourcebitmap. For example, if the bottom 10 rows of pixels of sourcebitmap were not to be moved, sourcebottom should be 10 The default value is 0.</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">destinationbitmap <span class="p">The bitmap that will receive the sourcebitmap. This is</span></p><p style="padding-left: 239pt;text-indent: 0pt;text-align: left;">often a window (actually the bitmap of a window, but Interlisp-D takes care of that for you).</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">destinationleft <span class="p">A number, starting at 0 for the left edge of the</span></p><p style="padding-left: 239pt;text-indent: 0pt;line-height: 107%;text-align: left;">destinationbitmap, that tells <span class="s3">BITBLT </span>where to start placing pixels from the sourcebitmap. For example, to place the</p><p style="padding-left: 239pt;text-indent: 0pt;text-align: left;">sourcebitmap 10 pixels in from the left, destinationleft should be 10. The default value is 0.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">destinationbottom <span class="p">A number, starting at 0 for the bottom edge of the</span></p><p style="padding-left: 239pt;text-indent: 0pt;line-height: 107%;text-align: left;">destinationbitmap, that tells <span class="s3">BITBLT </span>where to start placing pixels from the sourcebitmap. For example, to place the</p><p style="padding-left: 239pt;text-indent: 0pt;line-height: 11pt;text-align: left;">sourcebitmap 10 pixels up from the bottom,</p><p style="padding-left: 239pt;text-indent: 0pt;text-align: left;">destinationbottom should be 10. The default value is 0.</p><p class="s3" style="padding-top: 7pt;padding-left: 239pt;text-indent: -132pt;line-height: 107%;text-align: left;">width <span class="p">How many pixels in each row of sourcebitmap should be moved. The samc amount of space is used in</span></p><p style="padding-left: 239pt;text-indent: 0pt;line-height: 11pt;text-align: left;">destinationbitmap to receive the sourcebitmap. If this</p><p style="padding-left: 239pt;text-indent: 0pt;line-height: 107%;text-align: left;">argument is <span class="s3">NIL</span>, it defaults to the number of pixels from sourceleft to the end of the row of sourcebitmap.</p><p class="s3" style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">height <span class="p">How many rows of pixels of sourcebitmap should be moved.</span></p><p style="padding-left: 239pt;text-indent: 0pt;text-align: left;">The same amount of space is used in destinationbitmap to receive the sourcebitmap. If this argument is <span class="s3">NIL</span>, it</p><p style="padding-left: 239pt;text-indent: 0pt;text-align: left;">defaults to the number of rows from sourcebottom to the top of the sourcebitmap.</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">sourcetype <span class="p">Refers to one of three ways to convert the sourcebitmap for</span></p><p style="padding-left: 239pt;text-indent: 0pt;text-align: left;">writing. For now, just use <span class="s3">INPUT</span>.</p><p class="s3" style="padding-top: 7pt;padding-left: 239pt;text-indent: -132pt;line-height: 107%;text-align: justify;">operation <span class="p">Refers to how the sourtebitmap gets </span>BITBLT <span class="p">d on to the destinationbitmap. </span>REPLACE <span class="p">will </span>BLT <span class="p">the exact</span></p><p style="padding-left: 239pt;text-indent: 0pt;line-height: 107%;text-align: justify;">sourcebitmap. Other operations allow you to <span class="s3">AND</span>, <span class="s3">OR </span>or <span class="s3">XOR </span>the bits from the sourcebitmap onto the bits on the destinationbitmap.</p><p class="s3" style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">texture <span class="p">J ust use </span>NIL <span class="p">for now.</span></p><p class="s3" style="padding-top: 7pt;padding-left: 106pt;text-indent: 0pt;text-align: left;">clippingregion <span class="p">J ust use </span>NIL <span class="p">for now.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">For more information on these operations, see Chapter 27 in the <i>IRM</i>.</p></li><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark17">DISPLAYSTREAMS</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_099.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 15pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">A displaystream is a genera Jized &quot;place to display&quot;. They determine exactly what is displayed where. One example of a displaystream is a window. Windows are the only</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">displaystreams that will be used in this chapter. If you want to draw on a bitmap that is not a window, other than with BITBLT, or want to use other types of displaystreams, please refer to Chapter 27 in the <i>IRM</i>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">This chapter explains functions for drawing on displaystreams: <span class="s3">DRAWLINE </span>, <span class="s3">DRAWTO</span>, <span class="s3">DRAWCIRCLE</span>., and <span class="s3">FILLCIRCLE</span>. In addition, functions for locating and changIng your curreAt position in the displaystream are covered: <span class="s3">DSPXPOSITION </span>, <span class="s3">DSPYPOSITION</span>, and <span class="s3">MOVETO</span>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a68">Drawing on a Displaystream </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The examples belowshow you how the functions for drawing on a display stream work. First, create a window. Windows are displaystreams, and the one you create are used for the examples in this chapter. Type:</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(SETQ EXAMPLE.WINDOW (CREATEW))</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a69">DRAWLlNE</a></h4><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">DRAWLINE <span class="p">draws a line in a displaystream. For example, type:</span></p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(DRAWLINE 10 15 100 150 5 INVERT EXAMPLE.WINDOW)</p><p style="padding-top: 7pt;padding-bottom: 2pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The results should look like Figure 15-1:</p><p style="padding-left: 168pt;text-indent: 0pt;text-align: left;"><span><img width="316" height="240" alt="image" src="Image_100.gif"/></span></p><p style="padding-top: 5pt;padding-left: 107pt;text-indent: 48pt;line-height: 164%;text-align: left;">Figure 15-1. Line Drawn onto the <span class="s3">EXAMPLE.WINDOW </span>Displayrtream The syntax of <span class="s3">DRAWLINE </span>is</p><p class="s3" style="padding-top: 1pt;text-indent: 0pt;text-align: right;">(DRAWLINE <span class="s4">x1 y1 x2 y2 width operation stream color dashing</span>)</p><p style="padding-top: 7pt;text-indent: 0pt;text-align: right;">The coordinates of the left bottom corner of the displaystream are 0 0.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 165%;text-align: left;">xl and yl x and y coordinates of the beginning of the line x2andy2 ending coordinates of the line</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">width width of the line, in pixels</p><p style="padding-top: 7pt;padding-left: 179pt;text-indent: -72pt;line-height: 106%;text-align: left;">operation way the line is to be drawn. <span class="s3">INVERT </span>causes the line to invert the bits that are already in the displaystream. Drawing a line the second time using <span class="s3">INVERT </span>erases the line. For other operations, see Chapter 27 in the <i>IRM.</i></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">stream displaystream. In this case, you used a window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 70pt;text-indent: 0pt;text-align: left;"><a name="a70">DRAWTO</a></h4><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">DRAWTO <span class="p">draws a line that begins at your current position in the displaystream. For example, type:</span></p><p class="s3" style="padding-top: 6pt;padding-left: 142pt;text-indent: 0pt;text-align: left;">(DRAWTO 120 135 5 INVERT EXAMPLE.WINDOW)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The results should look like Figure 15-2:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 170pt;text-indent: 0pt;text-align: left;"><span><img width="316" height="240" alt="image" src="Image_101.gif"/></span></p><p style="padding-top: 8pt;padding-left: 107pt;text-indent: 28pt;line-height: 188%;text-align: left;">Figure 15-2. Another Line drawn onto the <span class="s3">EXAMPLE.WINDOW </span>Displaystream The syntax of <span class="s3">DRAWTO </span>is</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(DRAWTO <span class="s4">x y width operation stream color dashing</span>)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 165%;text-align: left;">The line begins at the current position in the displaystream. x x coordinate of the end of the line</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">y y coordinate of the end of the line</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">width width of the line</p><p style="padding-top: 7pt;padding-left: 179pt;text-indent: -72pt;line-height: 106%;text-align: left;">operation way the lino is to be drawn. <span class="s3">INVERT </span>causes the line to invert the bits that aro already in tho displaystream. Drawing a line the second time using <span class="s3">INVERT </span>erases the line. For other operations, see Chapter 27 in the <i>IRM</i></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">stream displaystreom. In this case. you used a window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-top: 4pt;padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a71">DRAWClRCLE</a></h4><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">DRAWCIRCLE <span class="p">draws a circle on a displaystream. To use it, type:</span></p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(DRAWCIRCLE 150 100 30 (VERTICAL 5) NIL EXAMPLE.WINDOW<span class="p">)</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Now your window, <span class="s3">EXAMPLE.WlNDOW</span>, should look like Figure 15-3:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 192pt;text-indent: 0pt;text-align: left;"><span><img width="316" height="240" alt="image" src="Image_102.gif"/></span></p><p style="padding-top: 10pt;padding-left: 107pt;text-indent: 44pt;line-height: 164%;text-align: left;">Figure 15-3. Circle Drawn onto the <span class="s3">EXAMPLE.WlNDOW </span>Displaystream The syntax of <span class="s3">DRAWCIRCLE </span>is</p><p style="padding-top: 1pt;padding-left: 107pt;text-indent: 36pt;line-height: 164%;text-align: left;">(<span class="s3">DRAWCIRCLE </span><i>centerx centery radius brush dashing stream</i>) centerx x coordinate of the center of the circle</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 165%;text-align: left;">centery coordinate of the center of the circle radius radius of the circle in pixels</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">brush list.- The first- item of the list is the shape of the brush. Some of your</p><p style="padding-left: 179pt;text-indent: 0pt;line-height: 107%;text-align: left;">options include <span class="s3">ROUND</span>, <span class="s3">SQUARE</span>, and <span class="s3">VERTICAL</span>. The second item of that list is the width of the brush in pixels.</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">dashing list of positive integers. The brush is &quot;on&quot; for the number of units</p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">indicated by the first element of the list, &quot;off&quot; for the number of units</p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">indicated by the second element of the list. The third element specifies how long it will be on again, and so forth. The sequence is repeated until the circle has been drawn.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">stream displaystream. In this case, you used a window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a72">FlLLClRCLE</a></h4><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">FILLCIRCLE <span class="p">draws a filled circle on a displaystream. To use it, type:</span></p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(FILLCIRCLE 200 150 10 GRAYSHADE EXAMPLE.WINDOW)</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">EXAMPLE.WlNDOW <span class="p">now looks like Figure 15-4:</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 168pt;text-indent: 0pt;text-align: left;"><span><img width="316" height="240" alt="image" src="Image_103.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 73pt;line-height: 165%;text-align: left;">Figure 15-4. A filled circle drawn onto the displaystream The syntax of <span class="s3">FILLCIRCLE </span>is:</p><p style="padding-left: 107pt;text-indent: 36pt;line-height: 164%;text-align: left;">(<span class="s3">FILLCIRCLE </span><i>centerx centery radius texture stream</i>) centerx x coordinate of the center of the circle</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 165%;text-align: left;">centery y coordinate of the center of the ci rcle radius radius of the circle in pixels</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">texture shade that will be used to fill in the circle. Interlisp-D provides you with</p><p style="padding-left: 179pt;text-indent: 0pt;line-height: 107%;text-align: left;">three shades: <span class="s3">WHlTESHADE </span>, <span class="s3">BLACKSHADE</span>, and <span class="s3">GRAYSHADE</span>. You can also create your own shades. For more information on how to do this, see</p><p style="padding-left: 179pt;text-indent: 0pt;line-height: 11pt;text-align: left;">Chapter 27 in the <i>IRM</i>.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">stream displaystream. In this case, you used a window</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">There are many other functions for drawing on a displaystream. Please refer to Chapter 27 in the <i>IRM</i>.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">Text can also be placed into displaystreams. To do this, use printing functions such as <span class="s3">PRIN1 </span>and <span class="s3">PRIN2</span>, but supply the name of the displaystream as the &quot;file&quot; to print to. To place the text in the proper position in the displaystream, see the section below.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a73">Locating and Changing Your Position in a Displaystream </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">There are functions provided to locate, and to change your current position in a</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">displayitream. This can help you place text, and other images where you want them in</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">a displaystream. This primer will only discuss three of these. There are others, and they can be foun d in the Chapter 27 of the <i>IRM</i>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a74">DSPXPOSlTlON</a></h4><p class="s3" style="padding-top: 8pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">DSPXPOSITION <span class="p">is a function that will either change the current x position in a</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">displaystream, or simply report it. To have the function report the current x position in</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">EXAMPLE.WlNDOW<span class="p">, type:</span></p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(DSPXPOSITION NIL EXAMPLE.WINDOW)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">DSPXPOSITION <span class="p">expects two arguments. The first is the new x position. If this argument is </span>NIL<span class="p">, the current position is not changed, merely reported. The second argument is</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">the displaystream.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a75">DSPYPOSlTlON</a></h4><p class="s3" style="padding-top: 8pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">DSPYPOSITION <span class="p">is an analogous function, but It changes or reports the current y</span></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">position in a displaystream. As with <span class="s3">DSPXPOSlTlON </span>, if the first argument is a number, the current y position will be changed to that position. If it is <span class="s3">NIL</span>, the current position is simply reported. To have the function report the current y position in <span class="s3">EXAMPLE.WlNDOW</span>, type:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(DSPYPOSITION NIL EXAMPLE.WlNDOW)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h4 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a76">MOVETO</a></h4><p style="padding-top: 8pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">The function <span class="s3">MOVETO </span>always changes your position in the displaystream. It expects three arguments:</p><p style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(<span class="s3">MOVETO </span><i>x y stream</i>)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><ol id="l16"><li><p style="padding-left: 179pt;text-indent: -72pt;text-align: left;">new x position in the display stream</p></li><li><p style="padding-top: 7pt;padding-left: 179pt;text-indent: -72pt;text-align: left;">new y position in the display stream</p></li></ol><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">stream display stream. The examples so far have used a window</p></li><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark18">FONTS</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_104.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 15pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">This chapter explains font s and font descriptors, what they are and how to use them, so that you can use functions requiring font descriptors</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">You have already been exposed to many font s in Medley. For example, when you use the structure editor, DEdit (see the Using the List Structure Editor section of Chapter 7), you noticed that the comments were printed in a smaller font than the code, and</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">that CLlSP words (see the CLISP section of Chapter 9) were printed in a darker font</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">than the other words in the function. These are only some of the font s that are available in Medley.</p><p style="padding-top: 7pt;padding-left: 106pt;text-indent: 0pt;text-align: left;">In addition to the font s that appear on your screen, Medley uses font s for printers that are different than the ones used for the screen. The font s used to print to the screen are called <span class="s3">DlSPLAYFONTS</span>. The font s used for prining are called <span class="s3">INTERPRESSFONTS </span>, or <span class="s3">PRESSFONTS</span>, depending on the type of printer.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a77">What Makes Up a Font </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Fonts are described by family, weight, slope, width, and size. This section discusses each of these, and describes how they affect the font you see on the screen.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">Family is one way that font s can differ. Here are some examples of how &quot;family&quot; affect s the look of a font:</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 164%;text-align: justify;">CLASSIC <span class="p">This family makes the word &quot;Able&quot; look like this: Able </span>MODERN <span class="p">This family makes the word &quot;Able&quot; look like this: </span><span class="s6">Able </span>TITAN <span class="p">This family makes the word &quot;Able&quot; look like this: </span>Able</p><p style="padding-top: 1pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">Weight also determines the look of a font. Once again, &quot;Able&quot; will be used as an example, this time only with the Classic family. A fonts weight can be:</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">BOLD <span class="p">And look like this: </span><span class="s10">Able</span></p><p class="s3" style="padding-top: 8pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">MEDIUM</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">or <span class="s3">REGULAR </span>And look like this: Able</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">The slope of a font is italic or regular. Using the Classic family font again, in a regular weight, the slope affect s the font like this:</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">ITALIC <span class="p">Looks like this: </span><span class="s4">Able</span></p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">REGULAR <span class="p">Looks like this: Able</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">The width of a font is called its &quot;expansion&quot;. It can be <span class="s3">COMPRESSED </span>, <span class="s3">REGULAR</span>, or</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">EXPANDED<span class="p">.</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Together, the weight, slope, and expansion of a font specifies the fonts &quot;face&quot;. Specifically, the face of a font is a three element list:</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(weight slope expansion)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">To make it easier to type, when a function requires a font face as an argument, it can be abbreviated with a three-character atom. The first specifies the weight, the second the</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">slope, and the third character the expansion. For example, some common font faces are abbreviated:</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">MRR <span class="p">This is the usual face, </span>MEDIUM<span class="p">, </span>REGULAR<span class="p">, </span>REGULAR</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">MIR <span class="p">Makes an italic font. It stands for: </span>MEDIUM <span class="p">, </span>ITALIC<span class="p">, </span>REGULAR</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;line-height: 20pt;text-align: left;">BRR <span class="p">Makes a bold font. The abbreviation means: </span>BOLD<span class="p">, </span>REGULAR <span class="p">, </span>REGULAR BIR <span class="p">Means that the font should be both bold and italic. </span>BIR <span class="p">stands for </span>BOLD<span class="p">,</span></p><p class="s3" style="padding-top: 1pt;padding-left: 179pt;text-indent: 0pt;text-align: left;">ITALIC<span class="p">, </span>REGULAR</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The above examples are used so oflen, that there are also more mnemonic abbreviations for them. They can also be used to specify a font face for a function that requires a face as an argument. They are:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 179pt;text-indent: -72pt;line-height: 107%;text-align: left;">STANDARD <span class="p">This is the usual face: </span>MEDIUM<span class="p">, </span>REGULAR<span class="p">, </span>REGULAR<span class="p">; it was abbreviated above, </span>MRR</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">ITALIC <span class="p">This was abbreviated above as </span>MIR<span class="p">, and specifies an italic font</span></p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">BOLD <span class="p">Makes a bold font; it was abbreviated above, </span>BRR</p><p class="s3" style="padding-top: 7pt;padding-left: 179pt;text-indent: -72pt;line-height: 107%;text-align: left;">BOLDITALIC <span class="p">Makes a font both bold and italic: </span>BOLD<span class="p">, </span>ITALIC <span class="p">, </span>REGULAR<span class="p">; it was abbreviated above, </span>BIR</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">A font also has a size. It is a positive integer that specifies the height of the font in</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">printers points. A point is, on an 1108 screen, about 1/72 of an inch. On the screen of an 1186, a point is 1/80 of an inch. The size of the font used in this chapter is 10. For</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 13pt;text-align: left;">comparison, here is an example of a <span class="s3">TITAN</span>, <span class="s3">MRR</span>, size 12 font: <span class="s13">Able</span>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 10pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a78">Fontdescriptors and FONTCREATE </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">For Medley to use a font, it must have a font descriptor. A font descriptor is a data type in Interlisp-D that that holds all the information needed in order to use a particular font. When you print out a font descriptor, it looks like this:</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">{FONTDESCRIPTOR}#74,45540</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Fontdescriptors are created by the function <span class="s3">FONTCREATE </span>. For example,</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(FONTCREATE HELVETICA 12 BOLD)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">creates a font descriptor that, when used by other functions, prints in <span class="s3">HELVETICA BOLD size 12</span>. Interlisp-D functions that work with font s expect a font descriptor produced</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 164%;text-align: left;">with the <span class="s3">FONTCREATE </span>function. The syntax of <span class="s3">FONTCREATE </span>is:</p><p class="s3" style="padding-top: 1pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(FONTCREATE <span class="s4">family size face</span><span class="p">)</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Remember from the previous section, face is either a three element list (weight slope expansion), a three character atom abbreviation, e.g. <span class="s3">MRR</span>, or one of the mnemonic</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">abbreviations, e.g. <span class="s3">STANDARD </span>.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">If <span class="s3">FONTCREATE </span>is asked to create a font descriptor that a J ready exists, the existing font descriptor is simply returned.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 4pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a79">Display Fonts </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Display font s require files that contain the bitmaps used to print each character on the screen. All of these files have the extension <span class="s3">.DlSPLAYFONT </span>. The file name itself</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">describes the font style and size that uses its bitmaps. For example:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">MODERN12.DISPLAYFONT</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">contains bitmaps for the font family <span class="s3">MODERN </span>in size 12 points. Wherever you put your</p><p class="s3" style="padding-left: 106pt;text-indent: 0pt;line-height: 107%;text-align: left;">.DISPLAYFONT <span class="p">files, you should make this one of the values of the variable </span>DISPLAYFONTDIRECTORIES<span class="p">. Its value is a list of directories to search for the bitmap files for display font s. Usually, it contains the &quot;</span>FONT<span class="p">&quot; directory where you copied the bitmap files, and the current connected directory. The current connected directory is</span></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">specified by the atom <span class="s3">NIL</span>. When looking for a <span class="s3">.DISPLAYFONT </span>file, the system checks the <span class="s3">FONT </span>directory on the hard disk, then the current connected directory.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Figure 16-1 shows an example value of <span class="s3">DISPLAYFONTDIRECTORIES </span>:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 175pt;text-indent: 0pt;text-align: left;"><span><img width="367" height="314" alt="image" src="Image_105.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 170pt;text-indent: 0pt;text-align: left;">Figure 16-1. Value for the Atom <span class="s3">DISFLAYFONTDIRECTORIES</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a80">InterPress Fonts </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">InterPress is the format that is used by Xerox laser printers. These printers normally have a resolution that is much higher than that of the screen: 300 points per inch.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To format files appropriately for output on such a printer, Interlisp must know the</p><p style="padding-left: 106pt;text-indent: 0pt;text-align: left;">actual size for each character that is to be printed. This is done through the use of width files that contain font width information for font s in InterPress format. For InterPress font s, you should make the location of these files one of the values of the variable <span class="s3">INTERPRESSFONTDIRECTORIES</span>. Its value is a list of directories to search for the font widths files for InterPress font s. Figure 16-2 is an example value of <span class="s3">INTERPRESSFONTDIRECTORIES</span>:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 173pt;text-indent: 0pt;text-align: left;"><span><img width="367" height="314" alt="image" src="Image_106.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 170pt;text-indent: 0pt;text-align: left;">Figure 16-2. Value for Atom <span class="s3">INTERPRESSFONTDIRECTORIES</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a81">Functions for Using Fonts </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-top: 4pt;padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a82">FONTPR0P Looking at Font Properties</a></h3><p style="padding-top: 10pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">It is possible to see the properties of a font descriptor. This s done with the function <span class="s3">FONTPROP</span>. For the following examples, the font descriptor used will be the one returned by the function <span class="s3">(DEFAULTFONT DISPLAY) </span>. In other words, the font descriptor</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">examined will be the default display font for the system.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">There are many properties of a font that might be useful for you. Some of these are:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">FAMILY <span class="p">To see the family of a font descriptor, type:</span></p><p class="s3" style="padding-top: 7pt;padding-left: 179pt;text-indent: 0pt;text-align: left;">(FONTPROP (DEFAULTFONT DISPLAY) FAMILY)</p><p class="s3" style="padding-top: 7pt;padding-bottom: 1pt;padding-left: 179pt;text-indent: -72pt;line-height: 107%;text-align: left;">SIZE <span class="p">As above, this is a positive integer that determines the height of the font in printers points. As an example, the </span>SIZE <span class="p">of the current default font is:</span></p><p style="padding-left: 188pt;text-indent: 0pt;text-align: left;"><span><img width="333" height="99" alt="image" src="Image_107.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 177pt;text-indent: 0pt;text-align: left;">Figure 16-3. Value of Font Property <span class="s3">SIZE </span>of Default Font</p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">ASCENT <span class="p">The value of this property is a positive integer, the maximum height of</span></p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;">any character in the specified font from the baseline (bottom). The top of</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 179pt;text-indent: 0pt;text-align: left;">the tallest character in the font, then, will be at <span class="s3">(BASELINE + ASCENT</span></p><p class="s3" style="padding-left: 179pt;text-indent: 0pt;text-align: left;">- l<span class="p">). For example, the </span>ASCENT <span class="p">of the default font is:</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 190pt;text-indent: 0pt;text-align: left;"><span><img width="333" height="99" alt="image" src="Image_108.gif"/></span></p><p style="padding-top: 8pt;padding-left: 178pt;text-indent: 0pt;text-align: left;">Figure 16-4. Value Font Property <span class="s3">ASCENT </span>of Default Font</p><p class="s3" style="padding-top: 7pt;padding-left: 179pt;text-indent: -72pt;line-height: 107%;text-align: justify;">DESCENT <span class="p">The </span>DESCENT <span class="p">is an integer that specifies the maximum number of points that a character in the font descends below the baseline (e.g.,</span></p><p style="padding-left: 179pt;text-indent: 0pt;line-height: 106%;text-align: justify;">letters such as &quot;p&quot; and &quot;g&quot; have tails that descend below the baseline.). The bottom of the lowest character in the font will be at <span class="s3">(BASELINE - DESCENT)</span>. To see the <span class="s3">DESCENT </span>of the default font, type:</p><p class="s3" style="padding-top: 6pt;padding-left: 107pt;text-indent: 72pt;line-height: 170%;text-align: left;">(FONTPROP (DEFAULTFONT DISPLAY) DESCENT) HEIGHT HEIGHT <span class="p">is equal to </span>(DESCENT - ASCENT)<span class="p">.</span></p><p style="padding-left: 179pt;text-indent: -72pt;line-height: 106%;text-align: left;"><span class="s3">FACE </span>The value of this property is a list of the form (<i>weight slope expansion</i>). These are the weight, slope, and expansion described above. You can see each one separately, also. Use the property that you are interested in, <span class="s3">WEIGHT</span>, <span class="s3">SLOPE</span>, or <span class="s3">EXPANSION</span>, instead of <span class="s3">FACE </span>as the second argument to <span class="s3">FONTPROP</span>.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">For other font properties, see Chapter 27 of the <i>IRM</i>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a83">STRlNGWlDTH</a></h3><p style="padding-top: 10pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">It is often useful to see how much space is required to print an expression in a particular font. The function <span class="s3">STRINGWIDTH </span>does this. For example, type:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(STRINGWIDTH &quot;Hi there!&quot; (FONTCREATE GACHA 10 STANDARD))</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The number returned is how many left to right pixels would be needed if the string</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">were printed in this font. (Note that this doesnt just work for pixels on the screen, but for all kinds of streams. For more information about streams, see Chapter 15.) Compare the number returned from the example call with the number returned when you change <span class="s3">GACHA </span>to <span class="s3">TIMESROMAN</span>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a84">DSPFONT - Changing the Font in One Window</a></h3><p style="padding-top: 10pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">The function <span class="s3">DSPFONT </span>changes the font in a single window. As an example of its use, first create a window to write in. Type:</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(SETQ MY.FONT.WINDOW (CREATEW))</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">in the Executive Window. Sweep out the window. To print something in the default font, type:</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(PRINT HELLO MY.FONT.WINDOW)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">in the Executive Window. Your window, <span class="s3">MY.FONT.WINDOW </span>, will look something like Figure 16-5:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 224pt;text-indent: 0pt;text-align: left;"><span><img width="230" height="172" alt="image" src="Image_109.gif"/></span></p><p style="padding-top: 7pt;padding-left: 145pt;text-indent: 0pt;text-align: left;">Figure 16-5. <span class="s3">HELLO</span>, Printed with the Default Font in <span class="s3">MY.FONT.WINDOW</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Now change the font in the window. Type:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(DSPFONT (FONTCREATE HELVETICA 12 BOLD) MY.FONT.WINDOW)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">in the Executive Window. The arguments to <span class="s3">FONTCREATE </span>can be changed to create any desired font. Now retype the <span class="s3">PRINT </span>statement, and your window will look something</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">like Figure 16-6:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 193pt;text-indent: 0pt;text-align: left;"><span><img width="312" height="211" alt="image" src="Image_110.gif"/></span></p><p style="padding-top: 8pt;padding-left: 107pt;text-indent: 90pt;line-height: 164%;text-align: left;">Flgure 16-6. Font in <span class="s3">MY.FONT.WINDOW </span>Changed Notice the font has been changed.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a85">Personalizing Your Font Profile</a></h3><p style="padding-top: 10pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Medley keeps a list of default font specifications. This list is used to set the font in all windows where the font is not specifically set by the user (see the <span class="s3">DSPFONT </span>section</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">above). The value of the atom <span class="s3">FONTPROFILE </span>is this list (see Figure 16-7).</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">A <span class="s3">FONTPROFILE </span>is a list of font descriptions that certain system functions access when printing output. It contains specifications for big font s (used when pretty printing a</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">function to type the function name), small font s (used for printing comments in the editor), and various other font s.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 196pt;text-indent: 0pt;text-align: left;"><span><img width="308" height="443" alt="image" src="Image_111.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 205pt;text-indent: 0pt;text-align: left;">Figure 16-7. Value of the Atom <span class="s3">FONTPROFILE</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">The list is in the form of an association list. The font class names (e.g., <span class="s3">DEFAULTFONT </span>, or <span class="s3">BOLDFONT</span>) are the keywords of the association list. When a number follows the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">keyword, it is the font number for that font class.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The lists following the font class name or number are the font specifications, in a form that the function <span class="s3">FONTCREATE </span>can use. The first font specification list affer a keyword</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">is the specification for printing to windows. The list<span class="s3">(GACHA 10) </span>in the figure above is an example of the default specification for the printing to windows. The last two font</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">specification lists are for Press and InterPress file printing, respectively. For more information, see Chapter 27 in the <i>IRM</i>.</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">Now, to change your default font settings, change the value of the variable <span class="s3">FONTPROFILE</span>. Medley has a list of profiles stored as the value of the atom <span class="s3">FONTDEFS </span>. Choose the profile to use, then install it as the default <span class="s3">FONTPROFILE </span>.</p><p style="padding-top: 7pt;padding-left: 106pt;text-indent: 0pt;line-height: 107%;text-align: left;">Evaluate the atom <span class="s3">FONTDEFS </span>and notice that each profile list begins with a keyword (see Figure 16-8). This keyword corresponds to the size of the font s included. <span class="s3">BIG</span>, <span class="s3">SMALL</span>, and <span class="s3">STANDARD </span>are some of the keywords for profiles on this list—<span class="s3">SMALL </span>and <span class="s3">STANDARD </span>appear in Figure 16-8.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 173pt;text-indent: 0pt;text-align: left;"><span><img width="367" height="202" alt="image" src="Image_112.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 197pt;text-indent: 0pt;text-align: left;">Figure 16-8. Part of Value of the Atom <span class="s3">FONTDEFS</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To install a new profile from this list, follow the following example, but insert any keyword for <span class="s3">BIG</span>.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">To use the profile with the keyword <span class="s3">BIG </span>instead of the standard one, evaluate the following expression:</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(FONTSET BIG))</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Now the font s are permanently replaced. (That is, until another profile is installed.)</p></li><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark19">THE INSPECTOR</a></h1></li></ol></li></ul></li></ol><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_113.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">The Inspector is a window-oriented tool designed to examine data structures. Because Medley is such a powerful programming environment, many types of data structures would be difficult to see in any other way.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a86">Calling the Inspector </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Take as an example an object defined through a sequence of pointers (i.e., a bitmap on the property list of a window on the property list of an atom inaprogram.)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To inspect an object named <span class="s3">NAME</span>, type:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(INSPECT NAME)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">If <span class="s3">NAME </span>has many possible interpretations, an option menu will appear. For example, in Interlisp-D, a litatom can refer to both an atom and a function. For example, if <span class="s3">NAME</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">was a record, had a function definition, and had properties on its property list, then the menu would appear as in Figure 17-1.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 263pt;text-indent: 0pt;text-align: left;"><span><img width="132" height="74" alt="image" src="Image_114.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 193pt;text-indent: 0pt;text-align: left;">Figure 17-1. Option Window for Inspection of <span class="s3">NAME</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">If <span class="s3">NAME </span>were a list, then the option menu shown in Figure 17.2 would appear. The options include:</p><ul id="l17"><li><p style="padding-top: 6pt;padding-left: 125pt;text-indent: -17pt;text-align: left;">Calling the display editor on the list</p></li><li><p style="padding-top: 7pt;padding-left: 125pt;text-indent: -17pt;text-align: left;">Calling the TTY editor (see Chapter 6)</p></li><li><p style="padding-top: 7pt;padding-left: 125pt;text-indent: -17pt;text-align: left;">Seeing the lists elements in a display window. If you choose this option, each</p><p style="padding-left: 125pt;text-indent: 0pt;text-align: left;">element in the list will appear in the right column of the Inspector window. The left column of the Inspector window will be made up of numbers (see Figure 17-3).</p></li><li><p style="padding-top: 7pt;padding-left: 125pt;text-indent: -17pt;text-align: left;">Inspecting the list as a record type (this last option would produce a menu of known record types). If you choose a record type, the items in the list will appear in the</p><p style="padding-left: 125pt;text-indent: 0pt;text-align: left;">right column of the Inspector window. The left column of the Inspector window will be made up of the field names of the record.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 273pt;text-indent: 0pt;text-align: left;"><span><img width="100" height="67" alt="image" src="Image_115.gif"/></span></p><p style="padding-top: 5pt;padding-left: 196pt;text-indent: 0pt;text-align: left;">Figure 17-2. Option Window for Inspection of List</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 4pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a87">Using the Inspector </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">If you choose to display your data structure in an edit window, simply edit the structure and exit in the normal manner when done. If you choose to display the data structure in an inspect window, then follow these instructions:</p></li><li><p style="padding-top: 7pt;padding-left: 125pt;text-indent: -17pt;text-align: left;">To select an item, point the mouse cursor at it and press the left mouse button.</p></li><li><p style="padding-top: 7pt;padding-left: 125pt;text-indent: -17pt;text-align: left;">Items in the right column of an Inspector window can themselves be inspected. To do this, choose the item, and press the center mouse button.</p></li><li><p style="padding-top: 7pt;padding-left: 125pt;text-indent: -17pt;text-align: left;">Items in the right column of an Inspector window can be changed. To do this, choose the corresponding item in the left column, and press the center mouse button. You</p></li></ul><p style="padding-left: 125pt;text-indent: 0pt;text-align: left;">will be prompted for the new value, and the item will be changed. The sequence of steps is shown in Figure 17-3.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">The item in the lefl column is selected, and the middle mouse button pressed. Select the</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">SET <span class="p">option from the menu that pops up.</span></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">You will then be prompted for the new value. Type it in.</p><p style="padding-top: 7pt;padding-bottom: 2pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The item in the right column is updated to the value of what you typed in.</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;"><span><img width="203" height="60" alt="image" src="Image_116.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 234pt;text-indent: 0pt;text-align: left;"><span><img width="203" height="107" alt="image" src="Image_117.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 361pt;text-indent: 0pt;text-align: left;"><span><img width="203" height="60" alt="image" src="Image_118.gif"/></span></p><p style="padding-top: 6pt;padding-left: 113pt;text-indent: 0pt;text-align: left;">Figure 17-3. Steps Involved in Changing Value in Right Column of Inspector Window</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a88">Inspector Example </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">This example will use ideas discussed in Chapter 21. An example, <span class="s3">ANlMALGRAPH </span>, is created in that section. You do not need to know the details of how it was created, but the structure is examined in this chapter.</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">If you type</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(INSPECT ANIMAL.GRAPH)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">and then choose the Inspect option from the menu, a display appears as shown in</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Figure 17-4. <span class="s3">ANlMAL.GRAPH </span>is being inspected as a list. Note the numbers in the left column of the inspectorwindow.</p><p style="text-indent: 0pt;text-align: left;"><span><img width="303" height="188" alt="image" src="Image_119.gif"/></span></p><ol id="l18"><li><p class="s6" style="padding-top: 3pt;padding-left: 457pt;text-indent: -457pt;text-align: right;">THE INSPECTOR</p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_120.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 43pt;line-height: 20pt;text-align: left;">Figure 17-4. Inspector Window For <span class="s3">ANIMAL.GRAPH </span>, Inspected as List If you choose the &quot;As A Record&quot; option, and choose &quot;<span class="s3">GRAPH</span>&quot; from the menu that</p><p style="padding-top: 1pt;padding-bottom: 1pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">appears, the inspector window looks like Figure 17-5. Note the fieldnames in the left column of the inspector window.</p><p style="padding-left: 147pt;text-indent: 0pt;text-align: left;"><span><img width="435" height="202" alt="image" src="Image_121.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 17-5. Inspector Window for <span class="s3">ANlMAL.GRAPH </span>, Inspected as Instance of <span class="s3">GRAPH</span></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Record</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">The remaining examples will use <span class="s3">ANlMAL.GRAPH </span>inspected as a list. When the first item in the Inspector window is chosen with the leff mouse button, the Inspector</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">window looks like Figure 17-6.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 197pt;text-indent: 0pt;text-align: left;"><span><img width="303" height="188" alt="image" src="Image_122.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 127pt;text-indent: 0pt;text-align: left;">Figure 17-6. Inspector Window for <span class="s3">ANlMAL.GRAPH </span>With First Element Selected</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">When you use the middle mouse button to inspect the selected list element, the display looks like Figure 17-7.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 184pt;text-indent: 0pt;text-align: left;"><span><img width="338" height="188" alt="image" src="Image_123.gif"/></span></p><p style="padding-top: 4pt;padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 17-7. Inspector Window for <span class="s3">ANlMAL.GRAPH </span>and for First Element of</p><p class="s3" style="padding-left: 111pt;text-indent: 0pt;text-align: center;">ANIMAL.GRAPH</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">How you can see that six items make up the list, and you can further choose to inspect one of these items. Notice that this is also inspected as a list. As usual, it could also</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">have been inspected as a record.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">Select item 5 - <span class="s3">MAMMAL DOG CAT </span>- with the left mouse button. Press the middle mouse button. Choose &quot;Inspect&quot; to inspect your choice as a list. The Inspector now displays the values of the structure that makes up <span class="s3">MAMMAL DOG CAT </span>. (See Figure 17-8.)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 235pt;text-indent: 0pt;text-align: left;"><span><img width="201" height="188" alt="image" src="Image_124.gif"/></span></p><p style="padding-top: 4pt;padding-left: 285pt;text-indent: -175pt;line-height: 107%;text-align: left;">Figure 17-8. Inspector Window for Element S From Figure 17.7 That Begins <span class="s3">((MAMMAL DOG CAT)</span>.</p></li><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark20">MASTERSCOPE</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_125.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 15pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Masterscope is a tool that allows you to quickly examine the structure of complex</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">programs. As your programs enlarge, you may forget what variables are global, what functions call other functions, and so forth. Masterscope keeps track of this for you.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To use Masterscope, first load <span class="s3">MASTERSCOPE.DFASL </span>and <span class="s3">EXPORTS.ALL</span>.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Suppose that <span class="s3">JVTO </span>is the name of a file that contains many of the functions involved in a complex system and that <span class="s3">LINTRANS </span>is the file containing the remaining functions. The first step is to ask Masterscope to analyze these files. These files must be loaded.</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">All Masterscope queries and commands begin with a period followed by a space, as in</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">. ANALYZE FNS ON MSCOPEDEMO</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">The <span class="s3">ANALYZE </span>process takes a while, so the system prints a period on the screen for each function it has analyzed. (See Figure 18-1)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 136pt;text-indent: 0pt;text-align: left;"><span><img width="402" height="85" alt="image" src="Image_126.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 18-1. Executive Window After Analyzing Files</p><p style="padding-top: 7pt;padding-left: 106pt;text-indent: 0pt;line-height: 107%;text-align: left;">If you are not quite sure what functions were just analyzed, type the files <span class="s3">COMS </span>variable (see the File Variables section in Chapter 7) into the Executive Window. The names of</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">the functions stored on the file will be a part of the value of this variable.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">A variety of commands are now possible, all referring to individual functions within the analyzed files. Substantial variation in exact wording is permitted. Some commands</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">are:</p><p class="s3" style="padding-top: 7pt;padding-left: 106pt;text-indent: 0pt;text-align: left;">. SHOW PATHS FROM ANY TO ANY</p><p class="s3" style="padding-left: 106pt;text-indent: 0pt;text-align: left;">. EDIT WHERE ANY CALLS <span class="s4">functionname</span></p><p class="s3" style="padding-left: 106pt;text-indent: 0pt;text-align: left;">. EDIT WHERE ANY USES <span class="s4">variablename</span></p><p class="s3" style="padding-left: 106pt;text-indent: 0pt;text-align: left;">. WHO CALLS WHOM</p><p class="s3" style="padding-left: 106pt;text-indent: 0pt;text-align: left;">. WHO CALLS <span class="s4">functionname</span></p><p class="s3" style="padding-left: 106pt;text-indent: 0pt;text-align: left;">. BY WHOM IS <span class="s4">functionname </span>CALLED</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">. WHO USES <span class="s4">variablename </span>AS FIELD</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 106pt;text-indent: 0pt;text-align: left;">Note that the function is being called to invoke each command. Refer to the <i>IRM </i>for commands not listed here.</p><p style="padding-top: 7pt;padding-left: 106pt;text-indent: 0pt;line-height: 107%;text-align: left;">Figure 18-2 shows the Executive Window after the commands <span class="s3">. WHO CALLS GobbleDump </span>and <span class="s3">. WHO DOES JVL inScan CALL</span>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 135pt;text-indent: 0pt;text-align: left;"><span><img width="402" height="86" alt="image" src="Image_127.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 18-2. Sample Masterscope Output</p><p class="s7" style="padding-top: 3pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"> 18. MASTERSCOPE </p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 4pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a89">SHOW DATA Command and GRAPHER </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">When the library package <span class="s3">GRAPHER </span>is loaded (to load this package, type <span class="s3">(FILESLOAD GRAPHER)</span>), Masterscopes <span class="s3">SHOWPATHS </span>command is modified. The command will be</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">changed to generate a tree structure showi ng how the programs functions interact instead of a tabular printout into the Executive window. For example, typing:</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">. SHOW PATHS FROM ProcessEND</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">produced the display shown in Figure 18-3.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 126pt;text-indent: 0pt;text-align: left;"><span><img width="428" height="152" alt="image" src="Image_128.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 18-3. <span class="s3">SHOW PATHS </span>Display Example</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">All the functions in the display are part of this analyzed file or a previously analyzed file. Boxed functions indicate that the function name has been duplicated in another place on the display.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Selecting any function name on the display will pretty print the function in a window (see Figure 18-4).</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 126pt;text-indent: 0pt;text-align: left;"><span><img width="428" height="152" alt="image" src="Image_129.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 177pt;text-indent: 0pt;text-align: left;"><span><img width="356" height="86" alt="image" src="Image_130.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 18-4. Browser Printout Example</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Selecting it again with the left mouse button will produce a desription of the functions role in the overall system (see Figure 18-5).</p><ol id="l19"><li><p class="s6" style="padding-top: 3pt;padding-left: 462pt;text-indent: -462pt;text-align: right;">MASTERSCOPE</p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_131.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 110pt;text-indent: 0pt;text-align: left;"><span><img width="428" height="152" alt="image" src="Image_132.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 188pt;text-indent: 0pt;text-align: left;"><span><img width="259" height="106" alt="image" src="Image_133.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 212pt;text-indent: 0pt;text-align: left;">Figure 18-5. Browser Description Example</p></li><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark21">WHERE DOES ALL THE TIME GO? SPY</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_134.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">SPY <span class="p">is an Lisp library package that shows you where you spend your time when you run your system. It is easy to learn, and very useful when trying to make programs run</span></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">faster.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a90">How to Use Spy with the SPY Window </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">The function <span class="s3">SPY.BUTTON </span>brings up a small window which you will be prompted to position. Using the mouse buttons in this window controls the action of the <span class="s3">SPY</span></p><p style="padding-bottom: 3pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">program. When you are not using <span class="s3">SPY</span>, the window appears as in Figure 19.1.</p><p style="padding-left: 276pt;text-indent: 0pt;text-align: left;"><span><img width="85" height="89" alt="image" src="Image_135.gif"/></span></p><p style="padding-top: 9pt;padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 19.1. <span class="s3">SPY </span>Window When <span class="s3">SPY </span>is Not Being Used</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">To use <span class="s3">SPY</span>, click either the left or middle mouse button with the mouse cursor in the</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">SPY <span class="p">window. The window will appear as in Figure 19.2, and means that </span>SPY <span class="p">is accumulating data about your program.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 278pt;text-indent: 0pt;text-align: left;"><span><img width="85" height="89" alt="image" src="Image_136.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 19.2. <span class="s3">SPY </span>Window When <span class="s3">SPY </span>is Being Used</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">To turn off <span class="s3">SPY </span>after the program has run, again click a mouse button in the <span class="s3">SPY</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">window. The eye closes, and you are asked to position another window. This window contains <span class="s3">SPY</span>s results. An example of the resulting window is shown in Figure 19.3.</p><p class="s7" style="padding-top: 3pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"> 19. WHERE DOES ALL THE TIME GO? SPY </p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 108pt;text-indent: 0pt;text-align: left;"><span><img width="477" height="204" alt="image" src="Image_137.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 195pt;text-indent: 0pt;text-align: left;">Figure 19.3. Window Produced After Running <span class="s3">SPY</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">This window is scrollable horizontally and vertically. This is useful, since the whole tree does not fit in the window. If a part that you want to see is not shown, you can scroll the window to show the part you want to see.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a91">How to Use SPY from the Lisp Top Level </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">SPY <span class="p">can also be run while a specific function or system is being used. To do this, type the function </span>WITH.SPY<span class="p">:</span></p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(WITH.SPY <span class="s4">form</span>)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The expression used for form should be the call to begin running the function or system that SPY is to watch. If you watch the <span class="s3">SPY </span>window, the eye will blink! To see your</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">results, run the function <span class="s3">SPY.TREE</span>. To do this, type:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(SPY.TREE)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">The results of the last running of <span class="s3">SPY </span>will be displayed. If you do this, and <span class="s3">SPY.TREE </span>returns (no <span class="s3">SPY </span>samples have been gathered), your function ran too fast for <span class="s3">SPY </span>to follow.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a92">Interpreting SPYs Results </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Each node in the tree is a box that contains, first, the percentage of time spent running that particular function, and second, the function name. There are two modes that can be used to display this tree.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The default mode is cumulative. In this mode, each percentage is the amount of time</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">that function spent on top of the stack, plus the amount of time spent by the functions it calls. The second mode is individual. To change the mode to individual, point to the title bar of the window, and press the middle mouse button. Choose <span class="s3">Individual </span>from the menu that appears. In this mode, the percentage shown is the amount of time the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">function spent on the top of the stack.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To look at a single branch of the tree, point with the mouse cursor at one of the nodes of the tree, and press the right mouse button. From the menu that appears, choose the</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_138.png"/></span></p><p class="s8" style="padding-left: 35pt;text-indent: 0pt;text-align: left;">19-2 <span class="s6">Medley for the Novice, Release 2.0</span></p><p class="s7" style="padding-top: 3pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"> 19. WHERE DOES ALL THE TIME GO? SPY</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">option <span class="s3">SubTree</span>. Another <span class="s3">SPY </span>window will appear, with just this branch of the tree in it.</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Another way to focu s within the tree is to remove branches from the tree. To do this, point to the node at the top of the branch you would like to delete. Press the middle mouse button, and choose <span class="s3">Delete </span>from the menu that appears.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">There are also different amounts of &quot;merging&quot; of functions that can be done in the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">window. A function can be called by another function more than once. The amount of merging determines where the subfunction, and the functions that it calls, appear in the tree, and how often. (For a detailed explanation of merging, see the <i>Lisp Library Packages Manual</i>.)</p></li><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark22">FREE MENUS</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_139.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 15pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Free Menu is a library package that is even more flexible than the regular menu package. It allows you to create menus with different types of items in them, and</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">format s them as you require. Free menus are particularly useful when you want a &quot;fill in the form&quot; type interaction with the user.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Each menu item is described with a list of properties and values. The following example will give you an idea of the structure of the description list, and some of your options.</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">The most commonly used properties, and each type of menu item will be described in the Parts of a Free Menu Item and Types of Free Menu Items section below.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a93">Free Menu Example </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Free menus can be created and formatted automatically! It is done with the function</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">FM.FORMATMENU<span class="p">. This function takes one argument, a description of the menu. The</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">description is a list of lists; each internal list describes one row of the free menu. A free menu row can have more than one item in it, so there are really lists of lists of lists! It really isnt hard, though, as you can see from the following example:</p><p class="s3" style="padding-top: 7pt;padding-left: 167pt;text-indent: -24pt;line-height: 88%;text-align: left;">(SETQ ExampleMenu (FM.FORMATMENU</p><p class="s3" style="padding-left: 215pt;text-indent: -24pt;line-height: 88%;text-align: left;">(((TYPE TITLE LABEL TitlesDoNothing) TYPE 3STATE LABEL Example3State))</p><p class="s3" style="padding-left: 203pt;text-indent: 0pt;line-height: 10pt;text-align: left;">((TYPE EDITSTART LABEL PressToStartEditing</p><p class="s3" style="padding-left: 209pt;text-indent: 96pt;line-height: 88%;text-align: left;">ITEMS (EDITEM)) (TYPE EDIT ID EDITEM LABEL &quot;&quot;))</p><p class="s3" style="padding-left: 191pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(WINDOWPROPS TITLE &quot;Example Does Nothing&quot;))))</p><p style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: justify;">The first row has two items in it: one is a <span class="s3">TITLE</span>, and the second is a <span class="s3">3STATE </span>item. The second row also has two items. The second, the <span class="s3">EDIT </span>item, is invisible, because its label is an empty string. The caret will appear for editing, however, if the <span class="s3">EDITSTART </span>item is chosen. Windowprops can appear as part of the description of the menu, because a</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: justify;">menu is, affer all, just a special window. You can specify not only the title with</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">WINDOWPROPS<span class="p">, but also the position of the free menu, using the &quot;left&quot; and &quot;bottom&quot;</span></p><p style="padding-left: 106pt;text-indent: 0pt;text-align: left;">properties, and the width of the border in pixels, with the &quot;border&quot; property. Evaluating this expression will return a window. You can see the menu by using the function <span class="s3">OPENW</span>. The following example illustrates this:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 235pt;text-indent: 0pt;text-align: left;">Figure 20.1. Example Free Menu</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">The next example shows you what the menu looks like after the <span class="s3">EDITSTART </span>item,</p><p class="s3" style="padding-left: 106pt;text-indent: 0pt;text-align: justify;">PressToStartEditing<span class="p">, has been chosen.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 185pt;text-indent: 0pt;text-align: left;">Figure 20.2. Free menu after <span class="s3">EDITSTART </span>Item Chosen</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">The following example shows the menu with the <span class="s3">3STATE </span>item in its <span class="s3">T </span>state, with the item highlighted. (In the previous bitmaps, it was in its neutral state.)</p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 11pt;text-align: left;">.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 182pt;text-indent: 0pt;text-align: left;">Figure 20.3. Free menu with <span class="s3">3STATE </span>Item in its <span class="s3">T </span>State</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Finally, Figure 20.4 shows the <span class="s3">3STATE </span>item in its <span class="s3">NIL </span>state, with a diagonal line through the item</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 169pt;text-indent: 0pt;text-align: left;">Figure 20.4 Free menu with the <span class="s3">3STATE </span>item in its <span class="s3">NIL </span>State</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">If you would like to specify the layout yourself, you can do that too. See the <i>Lisp Library Packages Manual </i>for more information.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a94">Parts of a Free Menu Item </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">There are eight different types of items that you can use in a free menu. No matter</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">what type, the menu item is easily described by a list of properties, and values. Some of the properties you will use most often are listed below:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 191pt;text-indent: -84pt;line-height: 107%;text-align: left;">LABEL <span class="p">Required for every type of menu item. It is the atom, string, or bitmap that appears as a menu selection.</span></p><p class="s3" style="padding-top: 6pt;padding-left: 191pt;text-indent: -84pt;line-height: 107%;text-align: left;">TYPE <span class="p">One of eight types of menu items. Each of these are described in the section below.</span></p><p class="s3" style="padding-top: 6pt;padding-left: 191pt;text-indent: -84pt;line-height: 107%;text-align: left;">MESSAGE <span class="p">The message that appears in the prompt window if a mouse button is held down over the item.</span></p><p class="s3" style="padding-top: 6pt;padding-left: 191pt;text-indent: -84pt;line-height: 107%;text-align: left;">ID <span class="p">An items unique identifier. An ID is needed for certain types of menu items.</span></p><p class="s3" style="padding-top: 6pt;padding-left: 191pt;text-indent: -84pt;line-height: 107%;text-align: left;">ITEMS <span class="p">Used to list a series of choices for an </span>NCHOOSE <span class="p">item, and to list the IDs of the editable items for an </span>EDITSTART <span class="p">item.</span></p><p class="s3" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">SELECTEDFN <span class="p">The name of the function to be called if the item is chosen.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a95">Types of Free Menu Items </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Each type of menu item is described in the following list, including an example description list for each one.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">MOMENTARY <span class="p">This is the familiar sort of menu item. When it is selected, the</span></p><p style="padding-left: 191pt;text-indent: 0pt;text-align: left;">function stored with it is called. A description for the function that creates and format s the menu looks like this:</p><p class="s3" style="padding-top: 6pt;padding-left: 191pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(TYPE MOMENTARY</p><p class="s3" style="padding-left: 215pt;text-indent: 0pt;line-height: 10pt;text-align: left;">LABEL Blink-N-Ring</p><p class="s3" style="padding-left: 215pt;text-indent: 0pt;line-height: 88%;text-align: left;">MESSAGE &quot;Blinks the screen and rings bells&quot; SELECTEDFN RINGBELLS)</p><p class="s3" style="padding-top: 6pt;padding-left: 191pt;text-indent: -84pt;line-height: 106%;text-align: left;">TOGGLE <span class="p">This menu item has two states, </span>T <span class="p">and </span>NIL<span class="p">. The default state is </span>NIL<span class="p">, but choosing the item toggles its state. The following is an example description list, without code for the </span>SELECTEDFN <span class="p">function, for this type of item:</span></p><p class="s3" style="padding-top: 6pt;padding-left: 191pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(TYPE TOGGLE</p><p class="s3" style="padding-left: 215pt;text-indent: 0pt;line-height: 88%;text-align: left;">LABEL DwimDisable SELECTEDFN ChangeDwimState)</p><ol id="l20"><li><p class="s6" style="padding-top: 3pt;padding-left: 473pt;text-indent: -473pt;text-align: right;">FREE MENUS</p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_140.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 190pt;text-indent: -84pt;line-height: 107%;text-align: left;">3STATE <span class="p">This type of menu item has three states, </span>NEUTRAL <span class="p">, </span>T<span class="p">, and </span>NIL. NEUTRAL <span class="p">is the default state. </span>T <span class="p">is shown by highlighting the item, and </span>NIL <span class="p">is shown with diagonal lines. The following is an example</span></p><p style="padding-left: 191pt;text-indent: 0pt;line-height: 107%;text-align: left;">description list, without code for the <span class="s3">SELECTEDFN </span>function, for this type of item:</p><p class="s3" style="padding-top: 6pt;padding-left: 190pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(TYPE 3STATE</p><p class="s3" style="padding-left: 214pt;text-indent: 0pt;line-height: 88%;text-align: left;">LABEL CorrectProgramAllOrNoSpelling SELECTEDFN ToggleSpellingCorrection)</p><p class="s3" style="padding-top: 6pt;padding-left: 191pt;text-indent: -84pt;line-height: 107%;text-align: left;">TITLE <span class="p">This menu item appears on the menu as dummy text. It does nothing when chosen. An example of its description:</span></p><p class="s3" style="padding-top: 6pt;padding-left: 190pt;text-indent: 0pt;text-align: left;">(TYPE TITLE LABEL &quot;Choices:&quot;)</p><p class="s3" style="padding-top: 7pt;padding-left: 191pt;text-indent: -84pt;line-height: 107%;text-align: left;">NWAY <span class="p">A group of items, nnly one of which can be chosen at a time. The items in the </span>NWAY <span class="p">group should all have an ID field, and the IDs</span></p><p style="padding-left: 190pt;text-indent: 0pt;text-align: left;">should be the same. For example, to set up a menu that would allow the user to choose between Helvetica, Gacha, Modern, and Classic font s, the descriptions might look like this (once again, without the code for the <span class="s3">SELECTEDFN</span>):</p><p class="s3" style="padding-top: 7pt;padding-left: 190pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(TYPE NWAY ID FONTCHOICE</p><p class="s3" style="padding-left: 214pt;text-indent: 0pt;line-height: 88%;text-align: left;">LABEL Helvetica SELECTEDFN ChangeFont)</p><p class="s3" style="padding-left: 190pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(TYPE NWAY ID FONTCHOICE</p><p class="s3" style="padding-left: 214pt;text-indent: 0pt;line-height: 10pt;text-align: left;">LABEL Gacha</p><p class="s3" style="padding-left: 190pt;text-indent: 24pt;line-height: 88%;text-align: left;">SELECTEDFN ChangeFont) (TYPE NWAY ID FONTCHOICE)</p><p class="s3" style="padding-left: 214pt;text-indent: 0pt;line-height: 88%;text-align: left;">LABEL Modern SELECTEDFN ChangeFont)</p><p class="s3" style="padding-left: 190pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(TYPE NWAY ID FONTCHOICE</p><p class="s3" style="padding-left: 214pt;text-indent: 0pt;line-height: 88%;text-align: left;">LABEL Classic SELECTEDFN Changefont)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 191pt;text-indent: -84pt;line-height: 107%;text-align: justify;">NCHOOSE <span class="p">This type of menu item is like </span>NWAY <span class="p">except that the choices are given to the user in a submenu. The list to specify an </span>NCHOOSE <span class="p">menu item that is analogous to the </span>NWAY <span class="p">item above might look like this:</span></p><p class="s3" style="padding-top: 7pt;padding-left: 190pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(TYPE NCHOOSE</p><p class="s3" style="padding-left: 214pt;text-indent: 0pt;line-height: 10pt;text-align: left;">LABEL FontChoices</p><p class="s3" style="padding-left: 214pt;text-indent: 0pt;line-height: 88%;text-align: left;">ITEMS Helvetica Gacha Modern Classic) SELECTDFN Changefont)</p><p class="s3" style="padding-top: 6pt;padding-left: 190pt;text-indent: -84pt;line-height: 107%;text-align: left;">EDITSTART <span class="p">When this type of menu itein is chosen, it activates another type of item, an </span>EDIT <span class="p">item. The </span>EDIT <span class="p">item or items associated with an </span>EDITSTART <span class="p">item have their lDs listed on the </span>EDITSTART <span class="p">s </span>ITEMS <span class="p">property. An example description list is:</span></p><p class="s3" style="padding-top: 6pt;padding-left: 190pt;text-indent: 0pt;text-align: left;">(TYPE EDITSTART LABEL &quot;Function to add?&quot; ITEMS (Fn))</p><p class="s3" style="padding-top: 7pt;padding-left: 106pt;text-indent: 0pt;text-align: left;">EDIT <span class="p">This type of menu item can actually be edited by you. It is often</span></p><p style="padding-left: 190pt;text-indent: 0pt;line-height: 106%;text-align: left;">associated with an <span class="s3">EDITSTART </span>item (see above), but the caret that prompts for input will also appear if the item itself is chosen. An <span class="s3">EDIT </span>item follows the same editing conventions as editing in</p><p style="padding-left: 191pt;text-indent: 0pt;text-align: left;">Executive Window:</p><p class="s10" style="padding-top: 7pt;padding-left: 191pt;text-indent: 0pt;text-align: left;">Add characters <span class="p">by typing them at the caret.</span></p><p class="s10" style="padding-top: 7pt;padding-left: 190pt;text-indent: 0pt;text-align: left;">Move the caret <span class="p">by pointing the mouse at the new position, and clicking the left button.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s10" style="padding-top: 4pt;padding-left: 191pt;text-indent: 0pt;text-align: left;">Delete characters <span class="p">from the caret to the mouse by pressing the right button of the mouse. Delete a character behind the caret by pressing the backspace key.</span></p><p class="s10" style="padding-top: 7pt;padding-left: 191pt;text-indent: 0pt;text-align: left;">Stop editing <span class="p">by typing a carriage return, a Control-X, or by choosing another item from the menu.</span></p><p style="padding-top: 7pt;padding-left: 191pt;text-indent: 0pt;text-align: left;">An example description list for this type of item is:</p><p class="s3" style="padding-top: 7pt;padding-left: 191pt;text-indent: 0pt;text-align: left;">(TYPE EDIT ID Fn LABEL **)</p></li><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark23">THE GRAPHER</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_141.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 14pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a96">Say it with Graphs </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">Grapher is a collection of functions for creating and displaying graphs, networks of nodes and links. Grapher also allows you to associate program behavior with mouse selection of graph nodes. To load this package, type</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(FILESLOAD GRAPHER)</p><p style="padding-top: 7pt;padding-bottom: 3pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Figure 21-1 shows a simple graph.</p><p style="padding-left: 178pt;text-indent: 0pt;text-align: left;"><span><img width="355" height="217" alt="image" src="Image_142.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 249pt;text-indent: 0pt;text-align: left;">Figure 21-1. Simple Graph</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">In Figure 21-1 there are six nodes (<span class="s3">ANIMAL </span>, <span class="s3">MAMMAL</span>, <span class="s3">DOG</span>, <span class="s3">CAT</span>, <span class="s3">FISH</span>, and <span class="s3">BIRD</span>)</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">connected by five links. A <span class="s3">GRAPH </span>is a record containing several fields. Perhaps the most</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">important field is <span class="s3">GRAPHNODES </span>—which is itself a list of <span class="s3">GRAPHNODE </span>records. Figure 21-2 illustrates these data structures. The window on top contains the fields from the simple</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 12pt;text-align: left;">graph. The window on the bottoms an inspection of the node, <span class="s3">DOG</span>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 147pt;text-indent: 0pt;text-align: left;"><span><img width="430" height="381" alt="image" src="Image_143.gif"/></span></p><p style="padding-top: 2pt;padding-left: 209pt;text-indent: 0pt;text-align: left;">Figure 21-2. Inspecting a Graph and a Node</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">The <span class="s3">GRAPHNODE </span>data structure is described by its text (<span class="s3">NODEID </span>), what goes into it (<span class="s3">FROMNODES</span>), what leaves it (<span class="s3">TONODES </span>), and other fields that specify its looks. The basic model of graph building is to create a bunch of nodes, then layout the nodes into a</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">graph, and finally display the resultant graph. This can be done in a number of ways.</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">One is to use the function <span class="s3">NODECREATE </span>to create the nodes, <span class="s3">LAYOUTGRAPH </span>to lay out the nodes, and <span class="s3">SHOWGRAPH </span>to display the graph. The primer shows you two simpler ways,</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">but please see the <i>Library Packages Manual </i>for more information about these other functions. The primers first method is to use <span class="s3">SHOWGRAPH </span>to display a graph with no nodes or links, then interactively add them. The second is to use the function</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">LAYOUTSEXPR<span class="p">, which does the appropriate </span>NODECREATES <span class="p">and a </span>LAYOUTGRAPH<span class="p">, with a list.</span></p><p style="padding-top: 6pt;padding-left: 110pt;text-indent: 0pt;text-align: left;">The function <span class="s3">SHOWGRAPH </span>displays graphs and allows you to edit them. The syntax of</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">SHOWGRAPH <span class="p">is</span></p><p class="s3" style="padding-top: 7pt;padding-left: 166pt;text-indent: -23pt;line-height: 107%;text-align: left;">(SHOWGRAPH <span class="s4">graph window lefibuttonfn middlebuttonfn topjustifyflg alloweditflg copybuttoneventfn</span>)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Obviously the graph structure is very complex. Heres the easiest way to create a graph.</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(SETQ MY.GRAPH NIL)</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(SHOWGRAPH MY.GRAPH &quot;My Graph&quot; NIL NIL NIL T)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 179pt;text-indent: 0pt;text-align: left;"><span><img width="350" height="195" alt="image" src="Image_144.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 21-3. My Graph</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">You will be prompted to create a small window as in Figure 21-3. This graph has the title My Graph. Hold down the right mouse button in the window. A menu of graph</p><p style="padding-bottom: 2pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">editing operations will appear as in Figure 21-4.</p><p style="padding-left: 248pt;text-indent: 0pt;text-align: left;"><span><img width="168" height="158" alt="image" src="Image_145.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 205pt;text-indent: 0pt;text-align: left;">Figure 21-4. Menu of Graph Editing Operations</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Heres how to use this menu. The commands in this menu are easy to learn. Experiment with them!</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a97">Add a Node</a></h3><p style="padding-top: 5pt;padding-bottom: 1pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Start by selecting <span class="s3">Add Node </span>. Grapher will prompt you for the name of the node (see Figure 21-5.) and then its position.</p><p style="padding-left: 228pt;text-indent: 0pt;text-align: left;"><span><img width="220" height="102" alt="image" src="Image_146.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 21-5. Grapher Prompts for Name of Node to add after Add Node is Chosen from Graph Editing Menu.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Position the node by moving the mouse cursor to the desired location and clicking a mouse button. Figure 21-6 shows the graph with two nodes added using this menu.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 270pt;text-indent: 0pt;text-align: left;"><span><img width="108" height="80" alt="image" src="Image_147.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 21-6. Two Nodes Added to <span class="s3">MY GRAPH </span>Using GraphEditing Menu</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a98">Add a Link</a></h3><p style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Select <span class="s3">Add Link </span>from the graph editing menu. The Prompt window will prompt you to select the two nodes to be linked. (See Figure 21-7.) Do this, and the link will be added.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 157pt;text-indent: 0pt;text-align: left;"><span><img width="408" height="66" alt="image" src="Image_148.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 269pt;text-indent: 0pt;text-align: left;"><span><img width="108" height="80" alt="image" src="Image_149.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 21-7. Prompt Window Requesting Selection of Two Nodes to Link, and Result</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a99">Delete a Link</a></h3><p style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Select <span class="s3">Delete Link </span>from the graph editing menu. ThePrompt window will prompt you to select the two nodes that should no longer be linked. (See Figure 21-8.) Do this, and</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">the link will be deleted.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 159pt;text-indent: 0pt;text-align: left;"><span><img width="405" height="58" alt="image" src="Image_150.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 270pt;text-indent: 0pt;text-align: left;"><span><img width="108" height="79" alt="image" src="Image_151.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 21-8. Prompt Window Requesting Selection of Link to Delete, and Result</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a100">Delete a Node</a></h3><p style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Select <span class="s3">Delete Node </span>from the graph editing menu. The Prompt window will prompt you to select the node to be aeleted. (See Figure 21-9.) Do this, and the node will be deletea.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 174pt;text-indent: 0pt;text-align: left;"><span><img width="372" height="38" alt="image" src="Image_152.gif"/></span></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 21.-9. Prompt to Delete a Node</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-top: 4pt;padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a101">Move a Node</a></h3><p style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">Select <span class="s3">Delete Node </span>from the graph editng menu. Choose a node pointing to the it with the mouse cursor, and pressing and holding the leff mouse button. When you move the mouse cursor, the node will be dragged along. When the node is at the new position,</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">release the mouse button to deposit the node.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a102">Making a Graph from a List </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Typically, a graph is used to display one of your programs data structures. Here is how that is done.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 93pt;text-indent: 0pt;text-align: center;">LAYOUTSEXPR <span class="p">takes a list and returns a </span>GRAPH <span class="p">record. The syntax of the function is</span></p><p style="padding-top: 7pt;padding-left: 91pt;text-indent: 0pt;text-align: center;">(<span class="s3">LAYOUTSEXPR </span><i>sexpr format boxing font motherd personald famlyd</i>)</p><p style="padding-top: 8pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">For example:</p><p class="s3" style="padding-top: 8pt;padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(SETQ ANIMAL.TREE (ANIMAL (MAMMAL DOG CAT) BIRD FISH)) (SETQ ANIMAL.GRAPH</p><p class="s3" style="padding-left: 143pt;text-indent: 30pt;line-height: 88%;text-align: left;">(LAYOUTSEXPR ANIMAL.TREE HORIZONTAL)) (SHOWGRAPH ANIMAL.GRAPH &quot;My Graph&quot; NIL NIL NIL T)</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">This is how Figure 21.1 was produced.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a103">Incorporating Grapher into Your Program </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The Grapher is designed to be built into other programs. It can call functions when, for example, a mouse button is clicked on a node. The function <span class="s3">SHOWGRAPH </span>does this:</p><p class="s3" style="padding-top: 7pt;padding-left: 166pt;text-indent: -23pt;line-height: 107%;text-align: left;">(SHOWGRAPH <span class="s4">graph window lefibuttonfn middlebuttonfn topjustifyflg alloweditflg copybuttoneventfn</span>)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">For example, the third argument to <span class="s3">SHOWGRAPH </span>, <i>leftbuttonfn</i>, is a function that is called when the left mouse button is pressed in the graph window. Try this:</p><p class="s3" style="padding-top: 7pt;padding-left: 173pt;text-indent: -30pt;line-height: 88%;text-align: left;">(DEFINEQ (My.LEFT.BUTT0N.FUNCTION (THE.GRAPHNODE THE.GRAPH.WINDOW)</p><p class="s3" style="padding-left: 203pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(INSPECT THE.GRAPHNODE)))</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 173pt;text-indent: -30pt;line-height: 88%;text-align: left;">(SHOWGRAPH FAMILY.GRAPH &quot;Inspectable family&quot; (FUNCTION MY.LEFT.BUTTON.FUNCTION)</p><p class="s3" style="padding-left: 203pt;text-indent: 0pt;line-height: 10pt;text-align: left;">NIL NIL T)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 95pt;text-indent: 0pt;text-align: center;">In the example above, <span class="s3">MY.LEFT.BUTTON.FUNCTION </span>simply calls the inspector. The</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">function should be written assuming it will be passed a graphnode and the window that holds the graph. Try adding a function of your own.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a104">More of Grapher </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Some other Library packages make use of the Grapher. (Grapher needs to be loaded with the packages to use these functions.)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><ul id="l21"><li><p class="s3" style="padding-top: 4pt;padding-left: 119pt;text-indent: -12pt;line-height: 107%;text-align: left;">MASTERSCOPE<span class="p">: The Browser package modifies the Masterscope command, </span>. SHOW PATHS<span class="p">, so that its output is displayed as a graph (using Grapher) instead of simply printed.</span></p></li><li><p class="s3" style="padding-top: 7pt;padding-left: 119pt;text-indent: -12pt;text-align: left;">GRAPHZOOM<span class="p">: allows a graph to be redisplayed larger or smaller automatically.</span></p></li></ul></li><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark24">RESOURCE MANAGEMENT</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_153.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a105">Naming Variables and Records </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">You will find times when one environment simultaneously hosts a number of different programs. Running a demo of several programs, or reloading the entire Medley</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">environment from floppies when it contains several different programs, are two</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">examples that could, if you arent careful, provide a few problems. Here are a few tips on how to prevent problems:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><ul id="l22"><li><p style="padding-left: 119pt;text-indent: -10pt;line-height: 107%;text-align: justify;">If you change the value of a system variable, <span class="s3">MENUHELDWAIT </span>for example, or connect to a directory other than <span class="s3">{DSK}&lt;LISPFILES&gt; </span>, write a function to reset the variable or directory to its original value. Run this function when you are finished working.</p><p style="padding-left: 119pt;text-indent: 0pt;line-height: 11pt;text-align: justify;">This is especially important if you change any of the system menus.</p><p style="text-indent: 0pt;text-align: left;"><br/></p></li><li><p style="padding-left: 119pt;text-indent: -10pt;text-align: left;">Do not redefine Medley functions or CLISP words. Remember, if you reset an atoms value or function definition at the top level (in the Executive Window), the message (<i>Some.Crucial.Function.Or.Variable </i><span class="s3">redefined) </span>, appears. If this is not what you wanted, type <span class="s9">UNDO </span>immediately!</p><p style="padding-top: 10pt;padding-left: 119pt;text-indent: 0pt;text-align: left;">If, however, you reset the value or function definition of an atom inside your program, a warning message will not be printed.</p><p style="text-indent: 0pt;text-align: left;"><br/></p></li><li><p style="padding-left: 119pt;text-indent: -10pt;text-align: left;">Make the atom names in your programs as unique as possible. To do this without filling your program with unreadable names that noone, including you, can</p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">remember, prefix your variable names with the initials of your program. Even then, check to see that they are not already being used with the function <span class="s3">BOUNDP </span>. For</p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">example, type:</p><p class="s3" style="padding-top: 7pt;padding-left: 179pt;text-indent: 0pt;text-align: left;">(BOUNDP BackgroundMenu)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">This atom is bound to the menu that appears when you press the leff mouse button</p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">when the mouse cursor is not in any window. <span class="s3">BOUND</span>P returns <span class="s3">T</span>. <span class="s3">BOUNDP </span>returns <span class="s3">NIL</span></p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">if its argument does not currently have a value.</p><p style="text-indent: 0pt;text-align: left;"><br/></p></li><li><p style="padding-left: 117pt;text-indent: -9pt;text-align: left;">Make your function names as unique as possible. Once again, prefixing function</p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">names with the initials of your program can be helpful in making them unique, but even so, check to see that they are not already being used. <span class="s3">GETD </span>is the Interlisp-D function that returns the function definition of an atom, if it has one. If an atom has no function definition, <span class="s3">GETD </span>returns <span class="s3">NIL</span>. For example, type:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(GETD CAR)</p><p style="padding-top: 7pt;padding-left: 119pt;text-indent: 0pt;text-align: left;">A non-<span class="s3">NIL </span>value is returned. The atom <span class="s3">CAR </span>already has a function definition.</p><p style="text-indent: 0pt;text-align: left;"><br/></p></li><li><p style="padding-left: 119pt;text-indent: -11pt;line-height: 107%;text-align: left;">Use complete record field names in record <span class="s3">FETCH</span>es and <span class="s3">REPLACE </span>s when your code is not compiled. A complete record field name is a list consisting of the record</p><p style="padding-left: 119pt;text-indent: 0pt;line-height: 11pt;text-align: justify;">declaration name and the field name. Consider the following example:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(REC0RD NAME (FIRST LAST))</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(SETQ MyName (create Name FIRST <span class="s2"></span>John LAST <span class="s2"></span>Smith)) (FETCH (NAME FIRST) OF MyName)</p></li><li><p style="padding-top: 9pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">Avoid reusing names that are field names of Lisp system records. A few examples of system records follow. Do not reuse these names.</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(RECORD REGION (LEFT BOTTOM WIDTH HEIGHT)) (RECORD POSITION (XCOORD YCOORD))</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 4pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(RECORD IMAGEOBJ (- BITMAP -<span class="p">)))</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p></li><li><p style="padding-left: 119pt;text-indent: -11pt;text-align: left;">When you select a record name and field names for a new record, check to see whether those names have already been used.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 119pt;text-indent: 0pt;line-height: 107%;text-align: left;">Call the function <span class="s3">RECLOOK</span>, with your record name as an argument, in the Executive Window (see Figure 22-1). If your record name is already a record, the record</p><p style="padding-left: 119pt;text-indent: 0pt;line-height: 12pt;text-align: left;">definition will be returned; otherwise the function will return <span class="s3">NIL</span>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 191pt;text-indent: 0pt;text-align: left;"><span><img width="329" height="142" alt="image" src="Image_154.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 230pt;text-indent: 0pt;text-align: left;">Figure 22-1. Response to <span class="s3">RECLOCK</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 7pt;padding-left: 119pt;text-indent: 0pt;line-height: 106%;text-align: left;">Call the function <span class="s3">FIELDLOOK </span>with your new field name in the Executive Window (see Figure 22-2). If your field name is already a field name in another record, the record definition will be returned; otherwise the function will return <span class="s3">NIL</span>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 188pt;text-indent: 0pt;text-align: left;"><span><img width="329" height="142" alt="image" src="Image_155.gif"/></span></p><p style="padding-top: 9pt;padding-left: 226pt;text-indent: 0pt;text-align: left;">Figure 22-2. Response to <span class="s3">FIELDLOOK</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a106">Some Space and Time Considerations </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">In order for your program to run at maximum speed, you must efficiently use the space available on the system. The following section points out areas that you may not know are wasting valuable space, and tips on how to prevent this waste.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Often programs are written so that new data structures are created each time the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">program is run. This is wasteful. Write your programs so that they only create new variables and other data structures conditionally. If a structure has already been</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">created, use it instead of creating a new one.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Some time and space can be saved by changing your <span class="s3">RECORD </span>and <span class="s3">TYPERECORD</span></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: justify;">declarations to <span class="s3">DATATYPE </span>. <span class="s3">DATATYPE </span>is used the same way as the functions <span class="s3">RECORD </span>and <span class="s3">TYPERECORD</span>. In addition, the same <span class="s3">FETCH </span>and <span class="s3">REPLACE </span>commands can be used with the data structure <span class="s3">DATATYPE </span>creates. The difference is that the data structure</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">DATATYPE <span class="p">creates cannot be treated as a list the way </span>RECORD <span class="p">s and </span>TYPERECORD<span class="p">s can.</span></p><ol id="l23"><li><p class="s6" style="padding-top: 3pt;padding-left: 407pt;text-indent: -407pt;text-align: right;">RESOURCE MANAGEMENT</p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_156.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a107">Global Variables</a></h3><p style="padding-top: 8pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Once defined, global variables remain until Lisp is reloaded. Avoid using global</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">variables if at all possible! One specific problem arises when programs use the function</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">GENSYM<span class="p">. In program development, many atoms are created that may no longer be useful. Hints:</span></p></li></ol></li><li><p style="padding-top: 6pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">Use</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(DELDEF <span class="s4">atomname </span>PROP)</p><p style="padding-top: 7pt;padding-left: 119pt;text-indent: 0pt;text-align: left;">to delete property lists, and</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(DELDEF <span class="s4">atomname </span>VARS)</p><p style="padding-top: 7pt;padding-left: 119pt;text-indent: 0pt;text-align: left;">to have the atom act like it is not defined.</p><p style="padding-top: 7pt;padding-left: 119pt;text-indent: 0pt;text-align: left;">These not only remove the definition from memory, but also change the appropriate <span class="s3">fileCOMS </span>that the deleted object was associated with so that the file package will not attempt to save the object (function, variable, record definition, and so forth) the next time the file is made. J ust doing something like</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(SETQ (<span class="s4">arg atomname</span>) NOBIND)</p><p style="padding-top: 7pt;padding-left: 119pt;text-indent: 0pt;line-height: 107%;text-align: left;">looks like it will have the same effect as the second <span class="s3">DELDEF </span>above, but the <span class="s3">SETQ </span>does not update the file package.</p></li><li><p style="padding-top: 6pt;padding-left: 119pt;text-indent: -11pt;line-height: 107%;text-align: left;">If you are generating atom names with <span class="s3">GENSYM </span>, try to keep a list of the atom names that are no longer needed. Reuse these atom names, before generating new ones.</p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">There is a (fairly large) maximum to the number of atoms you can have, but things slow down considerably when you create lots of atoms.</p></li><li><p style="padding-top: 6pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">When possible, use a data structure such as a list or an array, instead of many</p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">individual atoms. Such a structure has only one pointer to it. Once this pointer is</p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">removed, the whole structure will be garbage-collected and space will be reclaimed.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a108">Circular Lists</a></h3><p style="padding-top: 8pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">If your program is creating circular lists, a lot of space may be wasted. (Many</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">crosslinked data structures end up having circularities.) Hints when using circular lists:</p></li><li><p style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">Write a function to remove pointers that make lists circular when you are through with the circular list.</p></li><li><p style="padding-top: 7pt;padding-left: 119pt;text-indent: -10pt;text-align: left;">If you are working with circular lists of windows, bind your main window to a unique global variable. Write window creation conditionally so that if the binding of that</p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">variable is already a window, use it, and only create a new window if that variable is unbound or <span class="s3">NIL</span>.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">Here is an example that illustrates the problem. When several auxilIary windows are built, pointers to these windows are usually kept on the main windows property list.</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">Each auxilIary window also typically keeps a pointer to the main window on its</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: justify;">property list If the top level function creates windows rather than reusing existing ones, there will be many lists of useless windows cluttering the work space. Or, if such a main window is closed and will not be used again, you will have to break the links by deleting the relevant properties from both the main window and all of the auxiliary windows</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: justify;">first. This is usually done by putting a special <span class="s3">CLOSEFN </span>on the main window and all of its auxiliary windows.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h3 style="padding-top: 4pt;padding-left: 71pt;text-indent: 0pt;text-align: left;"><a name="a109">When You Run Out of Space</a></h3><p style="padding-top: 8pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">Typically, if you generato a lot of structure! that wont get garbage collected, you will eventually run out of space. The important part ii being aNe to track down those</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">structures and the code that generates them to become more space efficient.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: justify;">Use the Lisp Library Package <span class="s3">GCHAX.DCOM </span>to track down pointers to data structures. The basic idea is that <span class="s3">GCHAX </span>will return the number of references to a particular data structure.</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">A special function exists that allows you to get a little extra space so that you can try to save your work when you get toward the edge (usually noted by a message indicating</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">that you should save your work and load a new Medley environment). The <span class="s3">GAINSPACE</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">function allows you to delete non-essential data structures. To use it, type:</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(GAINSPACE)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">into the Executive Window. Answer <span class="s3">N </span>to all questions except the followi ng.</p></li><li><p style="padding-top: 7pt;padding-left: 118pt;text-indent: -9pt;text-align: left;">Delete edit history</p></li><li><p style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">Delete history list.</p></li><li><p style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">Delete values of old variables.</p></li><li><p style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">Delete your <span class="s3">MASTERSCOPE </span>database</p></li><li><p style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">Delete information for undoing your greeting.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Save your work and reload Lisp as soon as possible.</p><ol id="l24"><li><h1 style="padding-top: 5pt;padding-left: 71pt;text-indent: -36pt;line-height: 87%;text-align: left;"><a name="bookmark25">SIMPLE INTERACTIONS WITH THE CURSOR, A BITMAP, AND A WINDOW</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_157.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 15pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The purpose of this chapter is to show you how to build a moderately tricky interactive interface with the various Medley display facilities. In particular how to move a large</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">bitmap (larger than 16 x 16 pixels) around inside a window. To do this, you will change the <span class="s3">CURSORINFN </span>and <span class="s3">CURSOROUTFN </span>properties of the window. If you would also like to then set the bitmap in place in the window, you must reset the <span class="s3">BUTTONEVENTFN </span>. This chapter explains how to create the mobile bitmap.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a110">GETMOUSESTATE Example Function </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">One function that you will use to &quot;trace the cursor&quot; (have a bitmap follow the cursor around in a window) is <span class="s3">GETMOUSESTATE</span>. This function finds the current state of the. mouse, and resets global system variables, such as <span class="s3">LASTMOUSEX </span>and <span class="s3">LASTMOUSEY</span>.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">As an example of how this function works, create a window by typing</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(SETQ EXAMPLE.WINDOW (CREATEW))</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">into the Executive Window, and sweeping out a window. Now, type in the function</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(DEFINEQ (PRINTCOORDS (W)</p><p class="s3" style="padding-left: 173pt;text-indent: 0pt;line-height: 88%;text-align: left;">(PROMPTPRINT &quot;(&quot; LASTMOUSEX &quot;, &quot;LASTMOUSEY &quot;)&quot;) (BLOCK)</p><p class="s3" style="padding-left: 173pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(GETMOUSESTATE)))</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">This function calls <span class="s3">GETMOUSESTATE </span>and then prints the new values of <span class="s3">LASTMOUSEX </span>and</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">LASTMOUSEY <span class="p">in the promptwindow. To use it, type</span></p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(WINDOWPROP EXAMPLE.WINDOW CURSORMOVEDFN PRINTCOORDS)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">The window property <span class="s3">CURSORMOVEDFN</span>, used in this example, will evaluate the function <span class="s3">PRINTCOORDS </span>each time the cursor is moved when it is inside the window. The position coordinates of the mouse cursor will appear in the prompt window. (See Figure 23.1.)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 128pt;text-indent: 0pt;text-align: left;">Figure 23.1. Current Position Coordinates of Mouse Cursor in Prompt Window</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a111">Advising GETMOUSESTATE </a></h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">For the bitmap to follow the moving mouse cursor, the function <span class="s3">GETMOUSESTATE </span>is advised. When you advise a function, you can add new commands to the function</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">without knowing how it is actually implemented. The syntax for advise is</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(ADVISE <span class="s4">fn when where what</span>)</p><p class="s4" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">fn <span class="p">is the name of the function to be augmented. </span>when <span class="p">and </span>where <span class="p">are optional</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">arguments. <i>when </i>specifies whether the change should be made before, after, or around the body of the function. The values expected are <span class="s3">BEFORE </span>, <span class="s3">AFTER</span>, or <span class="s3">AROUND</span>.</p><p class="s4" style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">what <span class="p">specifies the additional code.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">In the example, the additional code, <i>what</i>, moves the bitmap to the position of the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">mouse cursor. The function <span class="s3">GETNOUSESTATE </span>will be <span class="s3">ADVISE</span>d when the mouse moves</p><p style="padding-left: 106pt;text-indent: 0pt;line-height: 106%;text-align: left;">into the window. This will cause the bitmap to follow the mouse cursor. <span class="s3">ADVISE </span>will be undone when the mouse leaves the window or when a mouse button is pushed. The <span class="s3">ADVISE</span>ing will be done and undone by changing the <span class="s3">CURSORINFN </span>, <span class="s3">CURSOROUTFN</span>, and <span class="s3">BUTTONEVENTFN </span>for the window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a112">Changing the Cursor </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">One last part of the example, to give the impression that a bitmap is dragged around a window, the original cursor should disappear. Try typing:</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(CURSOR (CURSORCREATE (BITMAPCREATE 1 l) 1 1]</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">into the Executive Window. This causes the original cursor to disappear. It reappears when you type</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(CURSOR T)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">When the cursor is invisible, and the bitmap moves as the cursor moves, the illusion is given that the bitmap is dragged around the window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a113">Functions for Tracing the Cursor </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To actually have a bitmap trace (follow) the cursor, the environment must be set up so that when the cursor enters the tracing region the trace is turned on, and when the</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">cursor leaves the tracing region the trace is turned off. The function <span class="s3">Establish/Trace/Data </span>will do this. Type it in as it appears (include comments that will help you remember what the function does).</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(DEFINEQ (Establish/Trace/Data</p><p class="s3" style="padding-left: 143pt;text-indent: -12pt;line-height: 88%;text-align: left;">[LAMBDA (wnd tracebitmap cursor/rightoffset cursor/heightoffset GCGAGP)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(* * This function is called to establish the data to trace the desired bitmap. &quot;wnd&quot; is the window in which the tracing is to take place, &quot;tracebitmap&quot; is the tracing bitmap, &quot;cursor/rightoffset&quot; and &quot;cursor/heightoffset&quot; are integers which detemine the hotspot of the tracing bitmap.</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">As &quot;cursor/heightoffset and &quot;cursor/rightoffset&quot; increase the cursor hotspot moves up and to the right.</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 10pt;text-align: left;">If GCGAGP is non-NIL, GCGAG will be disabled.)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">(PROG NIL</p><p class="s3" style="padding-top: 8pt;padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(if (OR (NULL wnd)</p><p class="s3" style="padding-left: 111pt;text-indent: 0pt;line-height: 10pt;text-align: center;">(NULL tracebitmap))</p><p class="s3" style="padding-left: 197pt;text-indent: -30pt;line-height: 88%;text-align: left;">then (PLAYTUNE (LIST (CONS 1000 4000))) (RETURN))</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(if GCGAGP</p><p class="s3" style="padding-left: 167pt;text-indent: 0pt;line-height: 11pt;text-align: left;">then (GCGAG))</p><p class="s3" style="padding-top: 8pt;padding-left: 155pt;text-indent: 0pt;text-align: left;">(* * Create a blank cursor.)</p><p class="s3" style="padding-top: 8pt;padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(SETQ *BLANKCURSOR*(BITMAPCREATE 16 16))</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(SETQ *BLANKTRACECURSOR*(CURSORCREATE *BLANKCURSOR*))</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 6pt;padding-left: 155pt;text-indent: 0pt;line-height: 88%;text-align: left;">(* * Set the CURSOR IN and OUT FNS for wnd to the following:)</p><p class="s3" style="padding-top: 9pt;padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(WINDOWPROP wnd (QUOTE CURSORINFN)</p><p class="s3" style="padding-left: 143pt;text-indent: 72pt;line-height: 88%;text-align: left;">(FUNCTION SETUP/TRACE)) (WINDOWPROP wnd (QUOTE CURSOROUTFN)</p><p class="s3" style="padding-left: 215pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(FUNCTION UNTRACE/CURSOR))</p><p class="s3" style="padding-top: 9pt;padding-left: 161pt;text-indent: -6pt;line-height: 88%;text-align: left;">(* * To allow the bitmap to be set down in the window by pressing a mouse button, include this line.</p><p class="s3" style="padding-left: 161pt;text-indent: 0pt;line-height: 10pt;text-align: left;">Otherwise, it is not needed)</p><p class="s3" style="padding-top: 8pt;padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(WINDOWPROP wnd (QUOTE BUTTONEVENTFN)</p><p class="s3" style="padding-left: 143pt;text-indent: 72pt;line-height: 88%;text-align: left;">(FUNCTION PLACE/BITMAP/IN/WINDOW)) (WINDOWPROP wnd (QUOTE CURSOROUTFN)</p><p class="s3" style="padding-left: 143pt;text-indent: 12pt;line-height: 20pt;text-align: left;">(* * Set up Global Variables for the tracing operation) (SETQ *TRACEBITMAP* tracebitmap</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(SETQ *RIGHTTRACE/OFFSET*(OR cursor/rightoffset 0)) (SETQ *HEIGHTTRACE/OFFSET*(OR cxursor heightoffset 0)) (SETQ *OLDBITMAPPOSITION*(BITMAPCREATE (BITMAPWIDTH</p><p class="s3" style="padding-left: 161pt;text-indent: 0pt;line-height: 9pt;text-align: left;">tracebitmap)</p><p class="s3" style="padding-top: 9pt;padding-left: 161pt;text-indent: 0pt;line-height: 11pt;text-align: left;">tracebitmap)))</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(SETQ *TRACEWINDOW* wnd]))</p><p class="s3" style="padding-left: 75pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(BITMAPHEIGHT</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">When the function <span class="s3">Establish/Trace/Data </span>is called, the functions <span class="s3">SETUP/TRACE </span>and</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">UNTRACE/CURSOR <span class="p">will be installed as the values of the windows </span>WlNDOWPROPS <span class="p">, and will be used to turn the trace on and off. Those functions should be typed in, then:</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 131pt;text-indent: -24pt;line-height: 88%;text-align: left;">(DEFINEQ (SETUP/TRACE [LAMBDA (wnd)</p><p class="s3" style="padding-top: 9pt;padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(* * This function is wnds CURSORINFN.</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">It simply resets the last trace position and the current tracing region. It also readvises GETMOUSESTATE to perform the trace function after each call.)</p><p class="s3" style="padding-top: 9pt;padding-left: 131pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(if *TRACEBITMAP*</p><p class="s3" style="padding-left: 167pt;text-indent: -24pt;line-height: 88%;text-align: left;">then (SETQ *LAST-TRACE-XPOS* -2000) (SETQ *LAST-TRACE-YPOS* -2000)</p><p class="s3" style="padding-left: 167pt;text-indent: 0pt;line-height: 88%;text-align: left;">(SETQ *WNDREGION* (WINDOWPROP wnd (QUOTE REGION))) (WINDOWPROP wnd (QUOTE TRACING)</p><p class="s3" style="padding-left: 191pt;text-indent: 0pt;line-height: 10pt;text-align: left;">T)</p><p class="s3" style="padding-top: 8pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(* * make the cursor disappear)</p><p class="s3" style="padding-top: 9pt;padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(CURSOR *BLANKTRACECURSOR*) (ADVISE (QUOTE GETMOUSESTATE)</p><p class="s3" style="padding-left: 179pt;text-indent: 0pt;line-height: 88%;text-align: left;">(QUOTE AFTER) NIL</p><p class="s3" style="padding-left: 179pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(QUOTE (TRACE/CURSOR]))</p><p class="s3" style="padding-top: 9pt;padding-left: 113pt;text-indent: -6pt;line-height: 88%;text-align: left;">(DEFINEQ (UNTRACE/CURSOR [LAMBDA (wnd)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(* * This function is wnds CURSOROUTFN. The function first checks if the cursor is currently being traced; if so, it replaces the tracing bitmap with what is under it and then turns tracing off by unadvising GETMOUSESTATE and setting the TRACING window property of *TRACEWINDOW* to NIL.)</p><p class="s3" style="padding-top: 9pt;padding-left: 113pt;text-indent: 0pt;text-align: left;">(if (WINDOWPROP *TRACEWINDOW*(QUOTE TRACING))</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 6pt;padding-left: 191pt;text-indent: -48pt;line-height: 88%;text-align: left;">then (BITBLT *OLDBITMAPPOSITION* 0 0 (SCREENBITMAP) (IPLUS (CAR *WNDREGION*)*LAST-TRACE-XPOS*) (IPLUS (CADR *WNDREGION*)*LAST-TRACE-YPOS*))</p><p class="s3" style="padding-left: 167pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(WINDOWPROP *TRACEWINDOW*(QUOTE TRACING)</p><p class="s3" style="padding-left: 287pt;text-indent: 0pt;line-height: 11pt;text-align: left;">NIL))</p><p class="s3" style="padding-top: 8pt;padding-left: 113pt;text-indent: 29pt;line-height: 177%;text-align: left;">(* * replace the original cursor shape) (CURSOR T)</p><p class="s3" style="padding-left: 113pt;text-indent: 29pt;line-height: 177%;text-align: left;">(* * unadvise GETMOUSESTATE) (UNADVISE (QUOTE GETMOUSESTATE]))</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">The function <span class="s3">SETUP/TRACE </span>has a helper function that you must also type in. It is</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">TRACE/CURSOR<span class="p">:</span></p><p class="s3" style="padding-top: 8pt;padding-left: 113pt;text-indent: -6pt;line-height: 88%;text-align: left;">(DEFINEQ (TRACE/CURSOR [LAMBDA NIL</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(* * This function does the actual BITBLTing of the tracing bitmap. This function is called after a GETMOUSESTATE, while tracing.)</p><p class="s3" style="padding-top: 6pt;padding-left: 34pt;text-indent: 0pt;line-height: 11pt;text-align: center;">(PROG ((xpos (IDIFFERENCE (LASTMOUSEX *TRACEWINDOW*)</p><p class="s3" style="padding-left: 191pt;text-indent: 0pt;line-height: 11pt;text-align: left;">*RIGHTTRACE/OFFSET*))</p><p class="s3" style="padding-top: 5pt;padding-left: 75pt;text-indent: 0pt;line-height: 11pt;text-align: center;">(ypos (IDIFFERENCE (LASTMOUSEY *TRACEWINDOW*)</p><p class="s3" style="padding-left: 191pt;text-indent: 0pt;line-height: 11pt;text-align: left;">*HEIGHTTRACE/OFFSET*))</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(* * If there is an error in the function, press the right button to unadvise the function. This will keep the machine from locking up.)</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(if (LASTMOUSESTATE RIGHT)</p><p class="s3" style="padding-left: 143pt;text-indent: 24pt;line-height: 88%;text-align: left;">then (UNADVISE (QUOTE GETMOUSESTATE))) (if (AND (NEQ xpos *LAST-TRACE-XPOS*)</p><p class="s3" style="padding-left: 197pt;text-indent: 0pt;line-height: 9pt;text-align: left;">(NEQ ypos *LAST-TRACE-YPOS*))</p><p class="s3" style="padding-left: 167pt;text-indent: 0pt;text-align: left;">then</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;line-height: 90%;text-align: left;">(* * Restore what was under the old position of the trace bitmap<span class="s14">)</span></p><p class="s3" style="padding-top: 6pt;padding-left: 191pt;text-indent: -24pt;line-height: 88%;text-align: left;">(BITBLT *OLDBITMAPPOSITION* 0 0 (SCREENBITMAP) (IPLUS (CAR *WNDREGION*)*LAST-TRACE-XPOS*) (IPLUS (CADR *WNDREGION*)*LAST-TRACE-YPOS*))</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(* * Save what will be under the position of the new trace bitmap)</p><p class="s3" style="padding-top: 7pt;padding-left: 191pt;text-indent: -24pt;line-height: 88%;text-align: left;">(BITBLT (SCREENBITMAP) (IPLUS (CAR *WNDREGION*)</p><p class="s3" style="padding-left: 111pt;text-indent: 0pt;line-height: 10pt;text-align: center;">xpos)</p><p class="s3" style="padding-left: 215pt;text-indent: -24pt;line-height: 88%;text-align: left;">(IPLUS (CADR *WNDREGION*) ypos)*OLDBITMAPPOSITION* 0 0)</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(* * BITBLT the trace bitmap onto the new position of the mouse)</p><p class="s3" style="padding-top: 7pt;padding-left: 191pt;text-indent: -24pt;line-height: 88%;text-align: left;">(BITBLT *TRACEBITMAP* 0 0 (SCREENBITMAP) (IPLUS (CAR *WNDREGION*)</p><p class="s3" style="padding-left: 111pt;text-indent: 0pt;line-height: 10pt;text-align: center;">xpos)</p><p class="s3" style="padding-left: 191pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(IPLUS (CADR *WNDREGION*)</p><p class="s3" style="padding-left: 111pt;text-indent: 0pt;line-height: 10pt;text-align: center;">ypos)</p><p class="s3" style="padding-left: 191pt;text-indent: 0pt;line-height: 88%;text-align: left;">NIL NIL (QUOTE INPUT) (QUOTE PAINT))</p><p class="s3" style="padding-top: 6pt;padding-left: 167pt;text-indent: -24pt;line-height: 150%;text-align: left;">(* * Save the current position as the last trace position.) (SETQ *LAST-TRACE-XPOS* xpos)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 5pt;padding-left: 167pt;text-indent: 0pt;text-align: left;">(SETQ *LAST-TRACE-YPOS* ypos]))</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">The helper function for <span class="s3">UNTRACE/CURSOR </span>, called <span class="s3">UNDO/TRACE/DATA</span>, must also be added to the environment:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 131pt;text-indent: -24pt;line-height: 88%;text-align: left;">(DEFINEQ (UNDO/TRACE/DATA [LAMBDA NIL</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 179pt;text-indent: -6pt;line-height: 88%;text-align: left;">(* * The purpose of this function is to turn tracing off and to free up the global variables used to trace the bitmap so that they can be garbage collected.)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 179pt;text-indent: 0pt;line-height: 88%;text-align: left;">(* * Check if the cursor is currently being traced. It so, turn it off.)</p><p class="s3" style="padding-top: 9pt;padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(UNTRACE/CURSOR)</p><p class="s3" style="padding-left: 215pt;text-indent: -72pt;line-height: 88%;text-align: left;">(WINDOWPROP *TRACEWINDOW*(QUOTE CURSORINFN) NIL)</p><p class="s3" style="padding-left: 215pt;text-indent: -72pt;line-height: 88%;text-align: left;">(WINDOWPROP *TRACEWINDOW*(QUOTE CURSOROUTFN) NIL)</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(SETQ *TRACEBITMAP* NIL)</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;line-height: 88%;text-align: left;">(SETQ *RIGHTTRACE/OFFSET* NIL) (SETQ *HEIGHTTRACE/OFFSET* NIL) (SETQ *OLDBITMAPPOSITION* NIL) (SETQ *TRACEWINDOW* NIL)</p><p class="s3" style="padding-top: 9pt;padding-left: 143pt;text-indent: 30pt;line-height: 177%;text-align: left;">(* * Turn GCGAG on) (GCGAG T]))</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Finally, if you included the <span class="s3">WlNDOWPROP </span>to allow the user to place the bitmap in the window by pressing a mouse button, you must also type this function:</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 131pt;text-indent: -24pt;line-height: 88%;text-align: left;">(DEFINEQ (PLACE/BITMAP/IN/WINDOW [LAMBDA (wnd)</p><p class="s3" style="padding-top: 9pt;padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">(UNADVISE (GETMOUSESTATE))</p><p class="s3" style="padding-left: 173pt;text-indent: -30pt;line-height: 88%;text-align: left;">(BITBLT *TRACEBITMAP* 0 0 (SCREENBITMAP) (IPLUS (CAR *WNDREGION*)</p><p class="s3" style="padding-left: 111pt;text-indent: 0pt;line-height: 10pt;text-align: center;">xpos)</p><p class="s3" style="padding-left: 173pt;text-indent: 0pt;line-height: 10pt;text-align: left;">(IPLUS (CADR *WNDREGION*)</p><p class="s3" style="padding-left: 111pt;text-indent: 0pt;line-height: 10pt;text-align: center;">ypos)</p><p class="s3" style="padding-left: 173pt;text-indent: 0pt;line-height: 88%;text-align: left;">NIL NIL (QUOTE INPUT) (QUOTE PAINT]</p><p style="padding-top: 6pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Thats all the functions!</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a114">Running the Functions </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To run the functions you just typed in, first set a variable to a window by typing something like</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(SETQ EXAMPLE.WINDOW (CREATEW))</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">into the Executive Window, and sweeping out a new window. Now, set a variable to a bitmap, by typing, perhaps,</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(SETQ EXAMPLE.BTM (EDITBM))</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Type</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">(Estab1ish/Trace/Data EXAMPLE.WINDOW EXAMPLE.BTM))</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">When you move the cursor into the window, the cursor will drag the bitmap.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">(If you want to be able to make menu selections while tracing the cursor, make sure</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">that the hotspot of the cursor is set to the extreme right of the bitmap. Otherwise, the menu will be destroyed by the <span class="s3">BITBLT </span>s of the trace functions.)</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To stop tracing, do one of the following:</p></li></ol></li><li><p style="padding-top: 7pt;padding-left: 117pt;text-indent: -9pt;text-align: left;">Move the mouse cursor out of the window</p></li><li><p style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">Press the right mouse button</p></li><li><p style="padding-top: 7pt;padding-left: 117pt;text-indent: -9pt;text-align: left;">Call the function <span class="s3">UNTRACE/CURSOR</span></p><ol id="l25"><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark26">GLOSSARY OF GLOBAL SYSTEM VARIABLES</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_158.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 15pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">As you can tell by now, there are many system variables in Medley that are useful to know. The following sections gather many of the important variables together into</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">groups relating to directory searching, system flags, history lists, system menus, windows, and, of course, the catchall miscellaneous category.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a115">Directories </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">DISPLAYFONTDIRECTORIES</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 106%;text-align: justify;">Its value is a list of directories to search for the bitmap files for display font s. Usually, it contains the <span class="s3">FONT </span>directory where you copies the bitmap files (see Chapter 16), and the current connected directory. The current connected</p><p style="padding-left: 143pt;text-indent: 0pt;line-height: 12pt;text-align: justify;">directory is specified by the atom <span class="s3">NIL</span>. Here is an example value of</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;text-align: left;">DISPLAYFONTDIRECTORIES<span class="p">.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 142pt;text-indent: 0pt;text-align: left;"><span><img width="450" height="256" alt="image" src="Image_159.gif"/></span></p><p style="padding-left: 107pt;text-indent: 62pt;line-height: 186%;text-align: left;">Figure 24.1. Value for the Atom <span class="s3">DISPLAYFONTDIRECTORIES INTERPRESSFONTDIRECTORIES</span></p><p style="padding-left: 143pt;text-indent: 0pt;line-height: 10pt;text-align: justify;">Is set to a list of directories to search for the font width files for InterPress font s.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">DIRECTORIES</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">This variable is bound to a list of the directories you will be using (see Figure 24-2). The system uses this variable when it is trying to find a file to load. It checks each directory in the list, until the file is foun d. <span class="s3">NIL </span>in list means to check the current connected directory.</p><p class="s3" style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">LISPUSERSDIRECTORIES</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">Its value is a list of directories to search for library package files.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 4pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a116">Flags </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">DWIMIFYCOMPFLG</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 106%;text-align: justify;">This flag, if set to <span class="s3">T</span>, will cause all expressions to be completely dwinified before the expression is compiled (see Chapter 9). In this state, when the system does not recognize a function of keyword, it will compare the word to a system</p><p style="padding-left: 143pt;text-indent: 0pt;line-height: 107%;text-align: justify;">maintained list to determine whether the word is a macro, <span class="s3">CLISP </span>word, or misspelled user-defined variable.</p><p style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;line-height: 107%;text-align: justify;">An example of swinifying before compilation is to convert an <span class="s3">IF </span>call to a <span class="s3">COND</span>. before they are compiled. Undwimified expressions can cause inaccurate</p><p style="padding-left: 143pt;text-indent: 0pt;line-height: 107%;text-align: justify;">compilation. This flag is set by the system to <span class="s3">NIL</span>. Normally, you want this set to <span class="s3">T</span>. For more information on DWIM, refer to the <i>IRM</i>.</p><p class="s3" style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">SYSPRETTYFLAG</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 107%;text-align: justify;">When set to <span class="s3">T</span>, all lists returned to the executive window are pretty printed. This flag is originally set by the system to <span class="s3">NIL</span>.</p><p class="s3" style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">CLISPIFTRANFLG</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 107%;text-align: justify;">When set to <span class="s3">T</span>, keeps the <span class="s3">IF </span>expression, rather than the <span class="s3">COND </span>translation in your code.</p><p class="s3" style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">PRETTYTABFLG</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 107%;text-align: justify;">When set to <span class="s3">T</span>, the pretty printer puts out a tab character rather than several spaces to try to make code align. If <span class="s3">NIL</span>, it uses space characters instead.</p><p class="s3" style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">FONTCHANGEFLG</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">If NIL, then when pretty printing no font changes will happen (e.g., a smaller font for comments, bold for clip words, and so forth). The default is the atom ALL, so different font s are used where appropriate.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">AUTOBACKTRACEFLG</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">There are many possible values for this variable. They affect when the back</p><p style="padding-left: 143pt;text-indent: 0pt;text-align: left;">trace window appears with the break window, and how much detail is included in it. The values of this variable include:</p><ul id="l26"><li><p class="s3" style="padding-top: 7pt;padding-left: 155pt;text-indent: -12pt;line-height: 107%;text-align: left;">NIL<span class="p">, its initial value. The back trace window is not brought up when an error is generated, until you open it yourself.</span></p></li><li><p class="s3" style="padding-top: 6pt;padding-left: 155pt;text-indent: -12pt;text-align: left;">T<span class="p">, which means that the back trace </span>BT <span class="p">window is opened for error breaks</span></p></li><li><p class="s3" style="padding-top: 7pt;padding-left: 155pt;text-indent: -12pt;line-height: 107%;text-align: left;">BT! <span class="p">brings up a back trace window with more detail, </span>BT!<span class="p">, window for error breaks</span></p></li><li><p class="s3" style="padding-top: 6pt;padding-left: 155pt;text-indent: -12pt;line-height: 107%;text-align: left;">ALWAYS <span class="p">brings up a backtrace </span>BT <span class="p">window for both error breaks, and breaks caused by calling the function </span>BREAK</p></li><li><p class="s3" style="padding-top: 7pt;padding-left: 155pt;text-indent: -12pt;line-height: 107%;text-align: left;">ALWAYS! <span class="p">brings up a backtrace window with more detail, </span>BT!<span class="p">, for both error breaks and breaks caused by calling the function</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">NOSPELLFLG</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">Is initially bound to <span class="s3">NIL</span>, so that <span class="s3">DWIM </span>tries to correct all spelling errors,</p><p style="padding-left: 143pt;text-indent: 0pt;text-align: left;">whether they are in a form you just typed in or within a function being run. If the variable is <span class="s3">T</span>, then no spelling correction is performed. This variable is</p><p style="padding-left: 143pt;text-indent: 0pt;text-align: left;">automatically reset to <span class="s3">T </span>when you are compiling a file. If it has some other non-</p><p class="s3" style="padding-left: 143pt;text-indent: 0pt;text-align: left;">NIL <span class="p">value, then spelling correction is only performed on type-in.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a117">History Lists </a></h2><p class="s3" style="padding-top: 10pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">LISPXHISTORY</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">Originally set to the list <span class="s3">(NIL 0 30 100) </span>, with the following argument</p><p style="padding-left: 143pt;text-indent: 0pt;line-height: 107%;text-align: left;">interpretation. The <span class="s3">NIL </span>is the list (implemented as a circular queue) to which the top level commands append. 0 is the current prompt number. 30 is the</p><p style="padding-left: 143pt;text-indent: 0pt;line-height: 11pt;text-align: left;">maximum length of the history list. 100 is the highest number used as a</p><p style="padding-left: 143pt;text-indent: 0pt;text-align: left;">prompt. This is a system maintained list used by the programmers assistant commands <span class="s3">REDO</span>, <span class="s3">UNDO</span>, <span class="s3">FIX</span>, and ?? use to retrieve past function calls.</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 107%;text-align: left;">To delete the history list, reset the variable <span class="s3">LISPXHISTORY </span>to its original value of <span class="s3">(NIL 0 30 100)</span>.</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">Setting this variable to <span class="s3">NIL </span>disables all the programmers assistant features.</p><p class="s3" style="padding-top: 10pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">EDITHISTORY</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 107%;text-align: left;">This is also set to (<span class="s3">NIL 0 30 100</span>), and has the same description as <span class="s3">LISPXHISTORY</span>. This list allows you to <span class="s3">UNDO </span>edits. You reset this the same way as <span class="s3">LISPXHISTORY</span>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a118">System Menus </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 106%;text-align: left;">System menus are all bound to global varieables and are easy to modyfy. If the menu name is set to the <span class="s3">NIL </span>value, the menu will be recreated using an items list bound to a global variable.</p><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To change a system menu, edit the items list bound to the appropriate global variable (system menus use this items list with the default <span class="s3">WHENSELECTEDFN </span>), then set the</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">value of the name to NIL. The next time you need the menu, it will be created from the items list you just edited. The names of system menus and the items lists follow.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">BackgroundMenu</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">This is the variable bound to the menu this displays when you press the right button in the grey background area of the screen.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">BackgroundMenuCommands</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 107%;text-align: left;">This list is used for the list of <span class="s3">ITEMS </span>for the background menu when it is created.</p><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">WindowMenu</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">This is the variable bound to the default window menu displayed when the right mouse button is pressed inside of a window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">WindowMenuCommands</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">This is the list of <span class="s3">ITEM</span>S for the WindowMenu.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">BreakMenu</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">The menu displayed when the middle mouse button is pressed in a break</p><p style="padding-left: 143pt;text-indent: 0pt;text-align: left;">window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">BreakMenuCommands</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">The list of <span class="s3">ITEM </span>for the BreakMenu.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a119">Windows </a></h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">PROMPTWINDOW</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">Global name of the prompt window.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">T</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">Although the value <span class="s3">T </span>has several meanings (such as universal <span class="s3">TRUE</span>), it also</p><p style="padding-left: 143pt;text-indent: 0pt;text-align: left;">stands for the standard output stream. As this is usually the executive window, it may be used as the name for the TTY Window at the top level. Mouse</p><p style="padding-left: 143pt;text-indent: 0pt;line-height: 106%;text-align: left;">processes have their own TTY Windows. A reference to the window T in a mouse driven function (e.g., a <span class="s3">WHENSELECTEFN</span>, Chapter 12) will open a TTY Window for Mouse.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 4pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="a120">Miscellaneous </a></h2><p class="s3" style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">CLEANUPOPTION</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: justify;">This is a list of options that you set to automate clean-up after a work session. Example options are listing files, or recompilation. You will want to keep this set to NIL until you become comfortable with the machine.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">FILELST</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: justify;">The list of all the files you loaded.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">SYSFILES</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: justify;">The list of all the files you loaded for the <span class="s3">SYSOUT </span>file.</p><p class="s3" style="padding-top: 10pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">INITIALS</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">An atom you can bind to your name. If bound, the editor will add your name, in addition to the date, in the editor comment at the beginning of each function.</p><p class="s3" style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">FIRSTNAME</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">If this variable is set, the system will use it to greet you personally when you log on to your machine.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-top: 5pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">INITIALSLST</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;line-height: 107%;text-align: left;">A list of elements of the form (<span class="s3">USERNAME </span>. I<span class="s3">NITIALS</span>) or (<span class="s3">USERNAME FIRSTNAME INITIALS</span>). This list is used by the function <span class="s3">GREET </span>to set your <span class="s3">INITIALS </span>, and your <span class="s3">FIRSTNAME </span>when you log in.</p><p class="s3" style="padding-top: 10pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">#CAREFULCOLUMNS</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">An integer. <span class="s3">PRETTYPRINT </span>estimates the number of characters in an atom,</p><p style="padding-left: 143pt;text-indent: 0pt;line-height: 106%;text-align: left;">instead of computing it, for efficiency. Unfortunately, for very long atom names, errors can occur. <span class="s3">#CAREFULCOLUMNS </span>is the number of columns from the right within which <span class="s3">PRETTYPRINT </span>should compute the number of characters in each</p><p style="padding-left: 143pt;text-indent: 0pt;line-height: 106%;text-align: left;">atom, to prevent these errors. Initially this is set to zero. <span class="s3">PRETTYPRINT </span>never computes the number of characters in an atom. If you set it to 20 or 30, when <span class="s3">PRETTYPRINT </span>comes within 20 or 30 columns of the right of the window, it will begin computing exactly how many characters are in each atom. This will</p><p style="padding-left: 143pt;text-indent: 0pt;text-align: left;">prevent errors.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">DWIMWAIT</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">Bound to the number of seconds DWIM should wait before it uses the default response, <span class="s3">FIXSPELLDEFAULT </span>, to answer its question.</p><p class="s3" style="padding-top: 10pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">FIXSPELLDEFAULT</p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">Bound to either <span class="s3">Y </span>or <span class="s3">N</span>. Its value is used as the default answer to questions</p><p style="padding-left: 143pt;text-indent: 0pt;line-height: 107%;text-align: left;">asked by <span class="s3">DWIM </span>that you dont answer in <span class="s3">DWIMWAIT </span>seconds. It is initially bound to Y, but is rebound to <span class="s3">N </span>when <span class="s3">DWIMIFY</span>ing.</p><p style="padding-top: 10pt;padding-left: 108pt;text-indent: 0pt;text-align: left;">\<span class="s3">TimeZoneComp</span></p><p style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">This is the global variable set to the absolute value of the time offset from Greenwich. For EST, \<span class="s3">TimeZoneComp </span>should be set to 5.</p></li></ul></li><li><h1 style="padding-top: 3pt;padding-left: 70pt;text-indent: -35pt;text-align: left;"><a name="bookmark27">OTHER USEFUL REFERENCES</a></h1></li></ol></li></ul></li></ol></li></ol></li></ol><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_160.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 15pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Here are some references to works that will be useful to you in addition to this primer. Some of these you have already been referred to, such as:</p><ul id="l27"><li><p style="padding-top: 7pt;padding-left: 118pt;text-indent: -9pt;text-align: left;">The Interlisp-D Reference Manual (IRM)</p></li><li><p style="padding-top: 7pt;padding-left: 118pt;text-indent: -9pt;text-align: left;">The Library Packages Manual</p></li><li><p style="padding-top: 7pt;padding-left: 118pt;text-indent: -9pt;text-align: left;">The Users Guide to SKETCH</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">In addition, you can learn more about Lisp with the books:</p></li><li><p class="s15" style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">Interlisp-D: The l a ngu ago a n d its usage <span class="p">by Steven H. Kaisler. This book was published in 1986 by John Wiley and Sons, NY.</span></p></li><li><p class="s15" style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">Essenti a l LISP <span class="p">by John Anderson, Albert Corbett, and Brian Reiser. This book was published in 1986 by Addison Wesley Publishing Company, Reading, MA. It was</span></p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">informed by research on how beginners learn LISP.</p></li><li><p class="s15" style="padding-top: 7pt;padding-left: 119pt;text-indent: -10pt;text-align: left;">The Little Lisper <span class="p">by Daniel P. Friedman and Matthias Felleisen. The second edition of this book was published in 1986 by SRA Associates, Chicago. This book is a</span></p><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">deceptively simple introduction to recursive programming and the flexible data structures provided by LISP.</p></li><li><p class="s15" style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">LISP <span class="p">by Patrick Winston and Berthold Horn. The second edition of this book was published in 1985 by the Addison Wesley Publishing Company, Reading, MA.</span></p></li><li><p class="s15" style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">LISP: A Gentle Introd uction to Symbolic Comp ut a tion <span class="p">by David S. Touretzky. This book was published in 1984 by the Harper and Row Publishing Company, NY.</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Finally, there are three articles about the Interlisp Programming environment:</p></li><li><p style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">Power Tools For Programmers byBeau Sheil. It appeared in <i>Datamation </i>in February, 1983, Pages 131 - 144.</p></li><li><p style="padding-top: 7pt;padding-left: 119pt;text-indent: -11pt;text-align: left;">The Interlisp Programming Environment by Warren Teitelman and Larry Masinter. It appeared in April, 1981, in <i>IEEE Computer</i>, Volume 14:1, Pages 25 - 34.</p></li><li><p style="padding-top: 7pt;padding-left: 118pt;text-indent: -10pt;text-align: left;">Programming In an Interactive Environment, the LISP Experience by Erik</p></li></ul><p style="padding-left: 119pt;text-indent: 0pt;text-align: left;">Sandewall. It appeared in March, 1978, in the <i>ACM Computing Surveys</i>, Volume 10:1, pages 35 - 71.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Each of these articles was reprinted in the book <i><b>Inter active Prog r amming</b></i></p><p class="s15" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Environ ments <span class="p">by David R. Barstow, Howard E. Shrobe, and Erik Sandewail. This</span></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">book was published in 1984 by McGraw Hill, NY. The first article can be foun d on pages 19 - 30, the second on pages 83 - 96, and the third on pages 31 - 80.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_161.png"/></span></p><p class="s6" style="padding-left: 35pt;text-indent: 0pt;text-align: left;">Medley for the Novice, Release 2.0</p><p class="s6" style="padding-top: 2pt;padding-left: 35pt;text-indent: 0pt;text-align: left;">25-1</p></body></html>