1
0
mirror of synced 2026-01-21 10:32:13 +00:00
Interlisp.medley/docs/primer/07-EDITING-AND-SAVING.TEDIT
2020-12-13 17:04:48 -07:00

179 lines
84 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.

1
Medley for the Novice, Release 2.0
1
Medley for the Novice, Release 2.0
7. EDITING AND SAVING
1
7. EDITING AND SAVING
1
"7"7. EDITING AND SAVING
6
This chapter explains how to define functions, how to edit them, and how to save your work.
Defining Functions(FUNCTIONS NIL Functions NIL NIL 1 SUBNAME DEFINING SUBTEXT defining)
1
DEFUN(DEFUN (Function) NIL NIL NIL 1) can be used to define new functions. The syntax for it is:
(DEFUN (<functionname> (<parameter-list><body-of-function>))
New functions can be created with DEFUN by typing directly into the Executive Window. Once defined, a function is a part of the Medley environment. For example, the function EXAMPLE-ADDER(EXAMPLE-ADDER (Function) NIL NIL NIL 1) is defined in Figure 7-1.
`ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÇúûÿ¿ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ»÷w½¿ßÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ»<7F>û÷¯¿ßÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ×vïçïß¿ïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿûïß¿ïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿï~ÿûﯿïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ×vï»ïw½¿ïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ»<>ÇöûÃ<C3BB>ßÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ÷ÿÿÿßÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿûÿÿÿ¿ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ000 Á€0À00
€0000 Á€À00
€`pG€1óϳ|ÌÎ=çÌð‡Ïž|àÏ38÷Ÿ3À}ãϳÏ<C2B3>€gÏ·Ï€ˆH¢@c6f3fgƒ36m™ðÌÙ³l03 ž ÌÙ¶`16f6lÀÆm¶f0€Œ c7æ3fã36mùóÌÙ¿`00 Œ<ÌÙ·à166lÀÆl6f c63f36m€ÌÙ°`600  lÌÙ¶166lÀÆl6f" c6f3fg36m˜ÌÙ³`603 žlÌÙ¶`16f6lÀÆl6frœ@aóÆfÌϳ7ÌðçÏž`à 3>Ìß3À0û3óÌÀÇÌ6c€€0f0f06ÛöÌ`a€ØÆÆcÆÀØÇÇ€{7¼Ï<>÷Ç€ûçÏæoyñçÏ<ÆÁ€8À<0ÀÆlÀË6ffÆlÀc6Ù³6lÍd<01> `f`ÆoÀã6ffÆoÀc6¿6lÍöp‡à<```Æl;6ffÆlc606l͇àl```ÆlÀ6ffÆlÀc6³6lÍ6L<01>€l`f`Æg€ñöfÆvg€;63ìÍñæx<01>€>À<`ÀÀ `a€ù„O>!ãÇÏ<18><46> Q$€¡FÈ<46> Q$ðAEH<45><Q'<27>€B%O |‰$
€£åH ù$ <18>%H $ù$H>‰ãÇÈ€pGˆH¸@  ˆˆ r@ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
Figure 7-1. Defining the Function EXAMPLE-ADDER
Now that the function is defined, it can be called from the Executive Window:
`<00>ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàà?ÿÿøÿ_xw÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàïÿÿÿ÷~î÷·ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàï÷qãÿ~õï÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿààzîÝüýûï÷ýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàïýàßÿ}ûï÷ýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàïýïßÿ}õï÷ýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàïúîÝ÷}î÷·ýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàà7qãøþßxp;ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàÿÿÿÿÿþÿÿÿûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàÿÿÿÿÿÿÿÿ÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿà``!D`@ãˆ````````ã<>` H`a„` B`!D`@ãˆ``````À  à`À 0Œ`ã<><ÌãÞ|Ï8|ùçÀ<0Œ` H fx33fÙŸ Í ``a„ ~0ó3fߟ<Í›ö À` B `1³3fØ `!D fy³3fÙ€lÍ6 `@㈠<Ìû3|Ï>|ùæ ð`` `` `````````````````
>@ `
@  `
XpÄM€xâÀ,Xpàˆ,8°à`dˆ$J€" ƒ$@2d‰H•2DɈ€`„J€" "@ùðH•"|€À`D€DJ€" $"@<40>H•"@€ <00>`Dˆ$Ê€" $@ "@‰I•2D<32>ˆ€`DpÃJ€ b#€"@pàF•,8€à```````````````````à<>` ˆ`b„` `!Ä`@àˆ````````à<>` ˆ`b„` `!Ä`@àˆ````````à<>` ˆ`b„` `!Ä`@àˆ``````ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿà
Figure 7-2.. After EXAMPLE-ADDER is defined, it can he executed
The function returns 6, after printing out the message.
Functions can also be defined using the editor DEdit described above. To do this, simply type
(ED function-name 'FUNCTIONS)
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:
`<01>°ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøÿÿÿÇúûÿ¿ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøÿÿÿ»÷w½¿ßÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿø»<7F>û÷¯¿ßÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿø×vïçïß¿ïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøÿûïß¿ïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøï~ÿûﯿïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿø×vï»ïw½¿ïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿø»<>ÇöûÃ<C3BB>ßÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøÿÿÿÿÿ÷ÿÿÿßÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøÿÿÿÿÿûÿÿÿ¿ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøˆâÈBÈB¨B¨B˜B˜Bˆãà`1ÀŽ0`3˜ pG€1ãàϾÍñçÙçÇŒˆH¢@c6`#³Í36l†0ƒ& cö`³Í›6n šc`³Í›6c†¢ c6`³Í36i†r@aãà}™áÙæo€0 0 øáÀÈ‘|pâ#€@<18> ™"!$@ <18> °à™"!$@
xqaLJ,ñ <0C>"Ɉ• !£" <11>B2<18> <08>! €> B"<18> “"!d@ B"<18> "“"!d@" BA"€áÀ<08>ˆàpâ#€
 A<>"pÀÁ8 ˆ@@ˆàC‡8ÑLJXáÀŽðâÀDÙ² Ž<8°ãÇaDHˆ2""d "A €&D©R È!ˆ™ðGÈ<â>@ Œ>A€"D©R Ÿˆ!ˆDD @  A€"D©Q@<08>ˆ!ˆDH‰D2""@ "A€&L©Q@ ˆ! ˆpàC‡<ÑÂ@Ž4©P€Žˆ À‡ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿüðïÿ÷ÿÿßñÿÿÇÿÿÿûÿÿÿÿÿûþ?üï¿ïÿ÷ÿÿß÷ÿÿÿßÿÿÿûÿÿÿÿÿûþÿüïøî<añü\ahñÓ†>?{Lé<4C>ߌ(ìð÷mÛ·îû·gnËÝì½ßs{3fmßsvçlÿpl÷øûØ7o`ßÝíÿ{{wnî¿{ï|ÿ·íû÷æûÛ÷ooßÝíüß{{wnî¿{~ï|ï·mÛ·îû·onßÝíýßsswnïsvï|ðxî<yñ|\woqßÞþ/wnïŽïlÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿìÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿüÿÿÿÿüŸçâA?<3F>ƒ~AƒÀ<00>ˆa ƒˆB@"<10>D <00>HQ E H"@"Š H<00>OÇÂI?E H"|Š H<00>HI ) H"@R" ˆ<00>HE ) H"@2R> H<00>ˆC ˆB@"A<10>D ŸäA?<3F>@"AŸçæ ?<00>ˆ ! ˆ@<00>H(@ <20> <00>OÇÅ(@ <20> <00>H¤D@? <00>H¤|@ <20> <00>ˆD! ˆ@ŸäD ‡€ŸçâA  ü<00>ˆa  <00>HQ <00>OÇÂI <00>HI I<00>HE )<00>ˆC ŸäA? üŸçä<00>ˆ<00>Hˆ<00>OÇÄH<00>HH<00>H(<00>ˆŸäâŸççÃùø<C3B9>Oçà<00>ˆ"˜H<00>H”H<00>OÇÄñð<00>HHà<00>HH<00>ˆ"<00>ÈŸäÃù<00>Ÿ @@@<00>@@@<00>G‰áfDpHK1f"G=p<00>HL@<40>™"Hˆ"ÈLÉ™"È‘ˆ<00>HH@<40>HH‰O<00>HH@<40>2h€2HH‰H<00>ˆH@<40>"Dˆ"ÈȉÈ‘Ÿˆ@aBpGH‰G0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿü
Figure 7-3 Selecting a Function Template
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.
Simple Editing in the Executive Window
1
First, type in an example function to edit:
3/41> (defun your-first-function (a b)
(if (> a b)
'(the first is greater)
'(the second is greater)))
To run the function, type:
3/42> (YOUR-FIRST-FUNCTION 3 5)
(THE SECOND IS GREATER)
Now, let's alter this. Type:
3/43> FIX 41
Note that your original function is redisplayed, and ready to edit. (SeeFigure 7-4.)
`ŒhÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÀÿÿñþ¾ðïïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþßÿÿÿîýÝïo÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþßîãÇþýëßï÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÀõÝ»ùû÷ßïûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþßûÁ¿þû÷ßïûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþßûß¿þûëßïûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþßõÝ»îûÝïoûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÀnãÇñý¾ðàwÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿýÿÿÿ÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿþÿÿÿïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþD‰"&H„D‰àâ%HD‰Cäù%HD‰ "$È„D˜D‰"$È„D˜8qÄG8ˆÀÀ8x8O >Ù€Xx"ÁÏØ !BƘBDÆü"CäÏ€DÙ€ üýûŒ 3æ7À·ÇŸ€~Æã>~Ïœ` Œ ÆÁƒÌ 666`6lÆ`ÆócØÞ`p ÆO  ÆÁƒÌf66`6n`ÆócØÞ`p Æ"ÁÆùólÆ66gß6g†|ÆÛ`ØÛ`0؃ !BÆÁƒl†67ÇØ7ÃÆ`ÆÛ`ØÛ`0Ø ÃBDÆÁƒ<†66`6`Æ`ÆÏcØÙà0ø Ã"CäÆÁƒ<†66`6lÆ`ÆÏcØÙà1Œ ÀDüý<C3BC>óƒãæ`6o†`|Ç>Ϙà1Œƒ   ·à ÀøÀ6`Ì`60Ì`7À0
€ø060
€Ì0600€Ì060`ÀÌ06Àø0`` Àa¿c~íñçàg€|ùøC÷ïŒc c`
1€lÀÆÍ€àÆ Æ# c`
<EFBFBD>€nÀÍ€àÆ ÆF |Í™á€g€ÎÍñ°ÇÌà c`
ðñ€cÀÆù<EFBFBD>°Æƒ c`
˜1€`ÀÆÍ<C386>ðÆ Ã c`
1€lÀÎ̓Æ Ã c~
á€o€vÍûÇìà a¿c~ÏÏ<C38F>œoÀg€|ùøC÷ïŒ0Àc c`lØÞl`lÀÆÍ€àÆ Æ`# c` ØÞl`nÀÍ€àÆ Æ`F |ϘÛl`g€ÎÍñ°ÇÌà 0 c`ìÛl`cÀÆù<C386>°Æƒ 0 c`lØÙì``ÀÆÍ<C386>ðÆ Ã 0 c`lØÙì`lÀÎ̓Æ Ã 0 c~ÏÏ<C38F>˜ïÀo€vÍûÇìà 0`` ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ
Figure 7-4. Using FIX to Edit a Fundion
Move the text cursor to the appropriate place in the function by positioning the mouse cursor and pressing the left mouse button.
Delete 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 highlighted text between the caret and mouse cursor is deleted when you release the right mouse button.
If you make a mistake, deletions can be undone. Press the UNDO key on the keypad to the left of the keyboard.
Now change GREATER to BIGGER:
1. Position the mouse cursor on the G of GREATER, and click the left mouse button. The text cursor is now where the mouse cursor is.
2. 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 "GREATER" is highlighted.
3. Release the right mouse button and GREATER is deleted.
4. Without moving the cursor, type in BIGGER.
5. There are two ways to end the editing session and run the function. One is to type Control-X. (Hold the Control key down, and type X.) Another is to move the text cursor to the end of the line and crù In both cases, the function has been edited!
Try the new version of the function by typing:
3/48> (YOUR-FIRST-FUNCTION 8 9)
(THE SECOND IS BIGGER)
and get the new result, or you can type:
3/49> REDO 42
(THE SECOND IS BIGGER)
Using the List Structure Editor
1
If the function you want to edit is not readily available (i.e. the function is not in the Executive Window, and you can't remember the history list number, or you simply have a lot of editing), use the List Structure Editor(LIST% STRUCTURE% EDITOR NIL List% Structure% Editor NIL NIL 3), often called SEdit. This editor is evoked with a call to ED:
81¬(ED 'YOUR-FIRST-FUNCTION 'FUNCTIONS)
Your function will be displayed in an edit window, as in Figure 7-5.
If there is no edit window on the screen, you will be prompted to create a window. As before, hold the leff mouse button down, move the mouse until it forms a rectangle of an acceptable size and shape, then release the button. Your function definition will automatically appear in this edit window.
`VŠ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿ¿ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ?ý·ï¼=öð;ÁÀ|
öûÀÞûüÿ÷ÿÿÿÿ}áßý÷<01>ÿÿÀ>ûý÷÷{Ýöû÷û}¾ûýýö{½÷Ýî{ýïÿ÷ÿÿÿÿ»Þßýöû¾ÿÿÀ>ÿÅ¡÷wíöû÷û}¿ûýýö»÷Ûö»ýî<wqâã¿×¿ßýöÿ¾ÿÿÀ?¹·ú÷íöûð{}ÃûüöÛ÷ÛöÛýíÛ¶îÜÝ¿ï¿ßý÷¾ÿÿÀ?÷½·ý÷íö÷ûýûýýöÛ÷ÛöÛüõøÞÁÿï¿ßý÷÷<C3B7>ÿÿÀ½·ý÷íöû7û}þûÍýöë÷ÛöëýüÛòæÞßÿ׿ßÍ÷û¾ÿÿÀ>û¹·ýûÝöû÷û}¾ûýýöó½÷ÝîóýýÛ·nÜÝÿ»Þßýöû¾ÿÿÀ?Źýü>û÷û}ÁûýþûÃ÷Þûýþ,w±bã¿}áÀþ¾ÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞÿ¿ÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿáÿÿÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ0À0À0À0À0À0À0#ó÷ìn0G<øãÃ<C3A3>€>Dˆã㇠<03>À0# o0H"€B$B<10>PAÀ0C o0ˆ"€B$B<10> P@€À0CçÌm°ˆ<ðCÃ<D©<00> PÀ€À0C (|€B€<00> ˆÀ0C $€BDB D™<10> øÀ0C "€B$B D™<10> ˆÀ0#óöÌp"€â# 8ˆàƒ‡ˆÁÀ0 À0À0À0À0À0À0@À0ƒ<>@@À0<00>  À0 <04>À0 <07>À0AÀ0ðAÀ0 AÀ0ƒˆ@À0À0@À0À0À0À0À0À0ùàŽ<8øÀ<|!óç‚À0!"D „@"@PBBÀ0 !"D „@"@PBAÀ0 !óÀ<0 ƒ<xPCÇ<43>À0 !( €€(@ˆBÀ0 !$D „@$@øB<04>À0 !"D „@"@ˆBAÀ0!à"8 À"|ˆCäBÀ0À0À0À0À0À0À0À0>DøÇÇ"xáÀ>ùóÁÀ0D€$2DB  (!!À0D€$2DB  (! <20>À0‡ˆ*DA€<(!ãÀ<C3A3>À0D€D*D@@ ” D!<>À0D€$&DB  |!@<40>À0D€$&DB  D! <20>À0ÇÇ"xáÀ>D!ò!À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ
Figure 7-5. An Edit Window
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 button you can select atoms or s-expressions. Repeated pressing of the middle button selects bigger pieces of text.
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 replace the first GREATER with LARGER, place the caret to the left of GREATER, as shown in Figure 7-6.
`VŠ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿ¿ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ?ý·ï¼=öð;ÁÀ|
öûÀÞûüÿ÷ÿÿÿÿ}áßý÷<01>ÿÿÀ>ûý÷÷{Ýöû÷û}¾ûýýö{½÷Ýî{ýïÿ÷ÿÿÿÿ»Þßýöû¾ÿÿÀ>ÿÅ¡÷wíöû÷û}¿ûýýö»÷Ûö»ýî<wqâã¿×¿ßýöÿ¾ÿÿÀ?¹·ú÷íöûð{}ÃûüöÛ÷ÛöÛýíÛ¶îÜÝ¿ï¿ßý÷¾ÿÿÀ?÷½·ý÷íö÷ûýûýýöÛ÷ÛöÛüõøÞÁÿï¿ßý÷÷<C3B7>ÿÿÀ½·ý÷íöû7û}þûÍýöë÷ÛöëýüÛòæÞßÿ׿ßÍ÷û¾ÿÿÀ>û¹·ýûÝöû÷û}¾ûýýöó½÷ÝîóýýÛ·nÜÝÿ»Þßýöû¾ÿÿÀ?Źýü>û÷û}ÁûýþûÃ÷Þûýþ,w±bã¿}áÀþ¾ÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞÿ¿ÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿáÿÿÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ0À0À0À0À0À0À0#ó÷ìn0G<øãÃ<C3A3>€>Dˆã㇠<03>À0# o0H"€B$B<10>PAÀ0C o0ˆ"€B$B<10> P@€À0CçÌm°ˆ<ðCÃ<D©<00> PÀ€À0C (|€B€<00> ˆÀ0C $€BDB D™<10> øÀ0C "€B$B D™<10> ˆÀ0#óöÌp"€â# 8ˆàƒ‡ˆÁÀ0 À0À0À0À0À0À0@À0ƒ<>@@À0<00>  À0 <04>À0 <07>À0AÀ0ðAÀ0 AÀ0ƒˆ@À0À0@À0À0À0À0À0À0ùàŽ<8øÀ<|!óç‚À0!"D „@"@PBBÀ0 !"D „@"@PBAÀ0 !óÀ<0 ƒ<xPCÇ<43>À0 !( €€(@ˆBÀ0 !$D „@$@øB<04>À0 !"D „@"@ˆBIÀ0!à"8 À"|ˆCä*À0À06À0cÀ0À0À0À0À0>DøÇÇ"xáÀ>ùóÁÀ0D€$2DB  (!!À0D€$2DB  (! <20>À0‡ˆ*DA€<(!ãÀ<C3A3>À0D€D*D@@ ” D!<>À0D€$&DB  |!@<40>À0D€$&DB  D! <20>À0ÇÇ"xáÀ>D!ò!À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À0À?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ
Figure 7-6. Caret Placement Prior to Changing GREATER with LARGER
Now press the DELETE key seven times, and type in LARGER. The window now looks like this:
`Tÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€`````````````````ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ÿÿÿÿßÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ƒ€þÛ÷Þûø<1D>àà>û}áÀoÿûÿÿÿÿ¾ðïþûƒ€Àÿ€}_}¿þûû½îû}ûý¾ß}þþû=Þûî÷=þ÷ÿûÿÿÿÿÝïoþû}¿ß€~?¿âÐû»öû}ûý¾ßýþþû]¿ûíû]þ÷;¸ñqßëßïþû¿ß}_‡<5F>ÜÛý{öû}ø=¾áýþûm¿ûíûmþöíÛwnnß÷ßïþû‡<C3BB>ßû¿ÞÛþûöûûý<C3BB>þýþþûm¿ûíûmþ<0F>úüo`ÿ÷ßïþûû¿Àÿ€ÿý¿ÞÛþûöû}›ý¾ÿ}æþûu¿ûíûuþþmùsooÿëßïæûý¿ßÿ}¿ÜÛþýîû}ûý¾ß}þþûyÞûî÷yþþíÛ·nnÿÝïoþû}¿ß€ÿƒ€âÜþþ}ûý¾àýþÿ}áûï}þÿ;رqß¾ðàƒ€ß€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿïßÿÿÿÿÿÿÿÿÿ€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿðÿÿÿÿÿÿÿÿÿÿÿ€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€`````` `GçïØÜ`Ž"xñLJ|‰ÇÇ" @`F6 Þ`"D„H„@‰’!2  `†6 Þ`"D„H„@‰’!2@ <04>`†7ϘÛ`"xà‡†x‰R*@ <07>`†6 Û`"Pù>@‰R*AA`†6 Ùà"H„ˆ„@‰2!&A`†6 Ùà"D„H„@‰2!&AA`Gçì˜àDÄG@qÁ"!`@ ` ```````@@ ` @ ` @`  ` à` @ ` ````````!ò'Àxqð ðãç‚` B$Dˆ@€ (‰B`@B$Dˆ@€ (‰A`@Cç€x`@Ç<>`@B$P@ D¡r`@B$Hˆ@€ |<04>`@B$Dˆ@€ D‰A` B'ÀDp@>DˆãäB` ```````|‰ð<03>ŽÀ<|!óç‚`H"dˆ„@"@PBB`H"dˆ„@"@PBA`ùà"Tˆƒ<xPCÇ<43>`ˆ"Tˆ€€(@ˆB`H"Lˆ„@$@øB<04>`H"Lˆ„@"@ˆBA`‰ð<03>ŽÀ"|ˆCäB```````````````````````````````````ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€
Figure 7-7. GREATER Changed to LARGER
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(CONTROL-X NIL Control-X NIL NIL 4), and the function will be redifined.
Commenting Functions
1
Text can be marked as a comment by typing a semi-colon before the text of the comment.
; This is the form of a comment
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 function level, and triple comments being on the far left, as is shown in Figure 7-8.
`EŸÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀÿÿÿÿýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ÷ø8í¿}áï°?<3F>Øào·Þð÷ßàÿÿ¿ÿÿÿûïÿï¸8Õ÷Ûÿï¿»Þï·ß¿Ûí÷ßïï³Ýï¾ïsßïÿ¿ÿÿÿýÞöÿï·ÛÀã÷ûþ-»¿o·ß¿ÛíÿßïïµÛÿ¾ßµßïqã»<C3A3>þ½þÿï·ûÀÕøxͿ׿o·ßƒÛîßàï¶Ûÿ¾ß¶ßïnÝ·væíÿ}þÿï¸x÷ÿ»ýí¿ï¿o°?¿Øïßïï¶Ûÿ¾ß¶ßàøß¯Æöÿ}þÿï¿»ÀÿÿÛýí¿ï¿o·Ù¿Ûï÷Þoï·[ÿ¾ß·_ïæß—6öÿþ½þþo¿ÛÀÿ÷ÛýÍ¿ïÞï·ß¿Ûí÷ßïï·<C3AF>ï¾ïwŸïîÝ»væïýÞöÿï·ÛÀÿø8-Ïïáðwß¿ÛîßïðwÞ¾ð÷ßïñc½ûïðx8ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ÷ýÿÿÿÿÿÿÿÀÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀÀÀÀÀÀ@À~~ý<>ƈâ'€xqðÈ‘|pâ p Àc`Á<>æ$@Dˆ@™"! 
H Àc`Á<>æQ$@Dˆ@™"! 
HÀc|ù<>Q'€x`@ˆ• ! 
xÀc`Á<>!%<0F>P! DÀc`Á<>ž!$€Hˆ@“"!`DÀc`Á<>ž!$@Dˆ@“"!`DÀ~~ÀùŽ áÄ@Dp@x À À@ÀÀÀÀÀÀÀÀfâÒçƒÄ/¸p\\YââÑÏ8<â/ÀfS$$Ĉ"bbjR$DDÀ$$„øBBBä|ð„À$$„€2BBB$@Àf$d„ˆ"bbB$DDÀfâƒÃ£„p\\AââÓ8 â#À"@@À"@@ÀDÀÀÀÀÀà@@@À!<00>@@ À !<00> D<ñ`àÀð ˜"H ¡À !"ˆ Ÿ P pÀ !>ˆ <10> h <01>À !"ˆ <08>"D  Àq"ð@ŽBñè@À@ÀÀÀÀÀÀ@À"|ñLJ8p>x À"@„H„ˆˆ D À"@„H„ˆˆ DÀ>xà‡†`<02><xÀ"@J PÀ"@„ˆ„ˆÉ HÀ"@„H„ˆH DÀ"|ÄG8päHŽ>D À À@ÀÀÀÀÀ@@€À@‡ÈŸ8øáÄO8ãÇÂ>x @À@<40><08>D<>&H€D$ D @ÀA<08>D<>&H€D$ D Àž%H€0Ç…<x À<08><08>%H€r„„ P À<08>D<>$È€DD„ H À<08>D<>$È€D$„ D À<00>Ÿ8øáÄO8â'È„>D @À @À@@€ÀÀÀÀÀÀ À À˜
#ÄD"'gÑâáÀÀ˜ $$D"(<28>¨2 À $"¨O<>àÀ¤"¨HÀ˜d!ˆ<>2 À˜ÑâÀÀˆÀˆÀÀÀÀÀ ÀÀÀÀÀÀÀÀÀÀ ÀÀÀÀÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ
Figure 7-8. Placement of Comments
There are other editor commands which can be very useful. To learn about them, read Appendix B of the Release Notes.
File Functions and Variables: How to See and Save Them
1
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 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, 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 INTERLISP (IL:) package.
File Variables(FILE% VARIABLES NIL File% Variables NIL NIL 5)
1
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 these variables. Two important variables follow.
ÿÿïfÿ FILELST evaluates to a list, all files that yoU have loaded into the Medley environment.
ÿÿïfÿ filenameCOMS (Each file loaded into the Lisp environment has associated with it a global variable, whose name is formed by appending COMS 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.
For example, if you type:
MYFILECOMS
the system will respond with something like:
((FNS YOUR-FIRST-FUNCTION )
VARS))
Saving Interlisp-D on Files
1
The functions (FILES?) and (MAKEFILE 'filename) are useful when it is time to save function, variables, windows, bitmaps, records and whatever else to files.
(FILES?) 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.
Type:
(FILES?)
the system will respond with something like:
the variables: MY.VARIABLE CURRENT.TURTLE...to be
dumped
the functions: RIGHT LEFT FORWARD BACKWARD
CLEAR-SCREEN...to be dumped
want to say where the above go?
If you type Y, the system will prompt with each item. There are three options:
1. 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.)
2. To skip the item, without removing it from consideration the next time (FILES?) is called, type crù This will allow you to postpone the decision about where to save the item.
3. If the item should not be saved at all, type ]. Nowhere will appear after the item.
Part of an example interaction is shown in the following figure:
ffÉÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€øÿÿÿí¾À@`wûƒƒ¿ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ûÿÿÿÿÝžûßï·û}½ßÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ûýÜxÿÝ®ûßï·û½ßÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ø»·½¶ûÀï·û‡½ïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ûÿx7ÿ½¶ûßàwûûƒïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ûÿ{÷ÿ½ºûßï·ûý¿ïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ûþ»·½¼ûßï·û}¿ïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ø
ÜxÿݾûÀo°;ƒ¿ßÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ÿÿÿÿÿßÿÿÿÿÿÿÿÿßÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ÿÿÿÿÿïÿÿÿÿÿÿÿÿ¿ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À¿lž0€À0l33€Çß0l83€Ä >l €Ç„|0l €ÀH 0l €ÄH0l3 €Ãˆ0oß¾ €À€À€À0€À€À€ÇÀ €Á €Á,8Ò&Ë€Á€2D2%L&€Á€"|%HŸ"€Á€"@%H<>"€Á€2D2eL&€Á,8Ñ¥K€À€À€À€À€À€ÄO>8<>ð@‡‡ãˆ8ˆà€ÆH <10>@DH€d<>"DÙ€ÆH <10>Xqa£‡<8DH„d<>R"DÙ€ÅO<<10>à"d dH€D¡G†TñSÁ D¨À€ÅH <10> DyD¢%T<>R€ÄÈ
<10> D‰$D£äˆ€L€¢"D©€ÄÈ
<10>"D‰dH€DB$H„L€¢"D©€ÄOŠ 8ùðDy£‡ 8B$GDø¢<03>Ÿ8ˆà€À €ÀÀ€À€À€À€Àò#€>|qð€À$@@ˆ@€À$B@ˆ@€Àâ£x`@€À €@@€Àd@@ˆ@€ÀdB@ˆ@€À#|p@€À€À€À€À€À€Àpp@ˆÀ€Àˆ@Ø" €ÀXÀˆãfÇ@pâÀ,Dqâ%‡Ù'x€Àd "<00>¥H™@ ˆ2Dˆ&H© " €ÀD><00>¥H@  D€$Œ©B €ÀD@ ¥H@"  D€$¨¢" €Àd2 "¥H@ ‰ Lˆd¨¢"H"$€ÀXÑÀpâ¥G|âÀ 4pa¤ˆˆ
€À@@€À@€À€À€À€Àp8À€À@ €ÀXÀñÃ<>Xp@xpâÀ€Àd "A$D"dˆ@ˆ™"  €ÀD>A$"D`  €ÀD@ A$"D  €Àd2 "A2$D"Dˆ@ "$ €ÀXÑÀ@Ò#ƒDp@â €À@€À@€À€À€À€À À€À@  €ÄG<ðàD°âÀ,8âÈŽ4p Ž€Ä@™A@$@2D$HLˆ@"€ÅGAT‰òÀ"|ò$EDˆŸ€ÅHAˆŠT‰"@$EDˆ€Âˆ‘I(‰@ "D$BLˆ"€Â‡‘ ‡„(ˆâ"8òÂ4p€À€À8 €À€À€À€€Á€Á€ÂŽ6lq`,qâÄG"Xpà@€Â*T‰<54>2ˆƒ$Hˆ"d‰@€Â*T‰ "`H"@øÀ@€Â*T‰"H"@€ @€Â*T‰2ˆȉ&@‰@€Á*TqÁ,pbG@pà€€Á €À€ €À€À€À€Ä@€ÆÀ€ÆÈ‘<XˆãÀD°âÀ€ÅHŒd‰"DÉ$@€ÅH@‰"T‰òÀ€ÅE@‰"T‰€ÅE@™ "(‰@€ÄB @hàÀ(ˆâ€À€À €À€À€À€€Á €Á@€Â,8ðáŇ€Â2D@"&H€Â"@@"$F€Â"@@"$A€Â"DH"$H€Á
"80!ÄG€Á€À€€À€À€À€ÇÀ8‰ñÄ€Ä É€ÄxpâÀpÃ<>ŽÉ€Çˆ™"  ˆ J©à„€Ä  ø#ÊŸ©€Ä  $J<>€Ä "$ ˆ$J€Äâ p#ÊŽÇÏ€€À€À€À€À€À€ÀpOŽ |à€À H @€Ã‹xpÈ€<8àH @G€ÄL ˆ$H€O x H€Ä ø'Ê€ðH @@€Ä" €$
È @ˆ€ÄH"$ˆ$EÈ @@ˆ€Ãˆp#…àH>|@€À€À€À€À€À€ÇÀ Ç>8qÈ‘|pâ#€>8p€Á  <>™"!$@ Dˆ€Á,8áÆË8h@ <>™"!$@ Dˆ€Á€2D%LD˜@ˆž<<10>Pˆ• !£<Dˆ€Á€"|%H|ˆ¹Sä! € Dˆ€Á€"@%H@ˆ ‰0“"!d@ Dˆ€Á€2D%LD˜@ ‰0“"!dF Dˆ€Á,8áÅK8h@>8qpâ# 8p€À€À€À€À€À€ÇÀ à@àƒˆŸ"ñÇ<C3B1>ŽDò$G8ˆàŽáÄO>xqóÄO€€Á A „"$H"d&H„"$H„ D‰$H€Á,8<>A „*$H"d&H„"$H„ D‰$H€Á€2D DD&A
„*â'<27> Tâ%HD¨À"$O<xaãÂ<C3A3>€Á€"| C"â!
„*%.Tù%H"$J Pˆ€Á€"@ @„"á „$ˆ"L$È„D™"$I H‰Bˆ€Á€2D DD&! „0$H"L$È„D™"0$H„ D‰!€Á,8#ˆ„ÄOŽDÄG8ˆà€áÈŽ>Dqò!€À€À  €À€À€À€À€À€ÇÎ€Ä €ÇŽ|€ÀQ €ÄQ€ÃŽ€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€À€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€
Figure 7-9. Part of an interaction using the function FILES?
(FILES?) assembles the items by adding them to the appropriate file's COMS variable (see the File Variables section above). (FILES?) does NOT write the file to secondary storage (disks or floppies). It only upclates the global variables discussed in the File Variables section above.
(MAKEFILE 'filename)
actually writes the file to secondary storage.
Type:
(MAKEFILE 'MY.FILE.NAME)
and the system will create the file. The function returns the full name of the file created. (i.e. {DSK}MY.FlLE.NAME.; 1).
Files written to (DSK) are permanent files. They can be removed only by the user deleting them or by reformatting the disk.
Other file manipulation functions can be found in Chapter 4.(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "7-" "") STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "7-" "")) (270 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (TEXT NIL NIL (54 54 504 690) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "7-" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD LEFT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "7-" "")) (54 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGV) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE VERSOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 684) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "7-" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "7-" "")) (270 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE RECTOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 684) NIL)))))!,llà2llà¢8HHà~<00>¢8HHà~<00>¢2llàT2llàT8H<00>à~<00>¢8H¢à~<00>¢8H<00>à~<00>¨2HHàZ5H<00>à~<00>2HHà
Z2HHàZ2HZàZ8llàœ´8llàœ´2llà,lHà2HTàT,HHà,HHà
,HHà,HHà
-àT-àT,HHà2àà5àÌàFøø PAGEHEADING VERSOHEADFøø PAGEHEADING RECTOHEADEøø PAGEHEADINGFOOTINGVEøø PAGEHEADINGFOOTINGR,
?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))
CLASSIC
TITAN
CLASSIC
TITAN
 HELVETICACLASSICMODERN HELVETICACLASSIC
 HELVETICA
MODERN

TIMESROMAN
  HRULE.GETFNMODERN
  " 
 HRULE.GETFNCLASSIC

#  
 HRULE.GETFNCLASSIC


 
 HRULE.GETFNCLASSIC



IM.CHAP.GETFN HELVETICA  HRULE.GETFNMODERN!
[

EIM.INDEX.GETFNCLASSIC
 HRULE.GETFNCLASSIC!
 IM.INDEX.GETFN=
="

(IM.INDEX.GETFN
!
H BMOBJ.GETFN3?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))
"

!
N
!
° BMOBJ.GETFN3?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))


8
^

 
<00>
"l BMOBJ.GETFN3?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))
(
®

' HRULE.GETFNCLASSIC,
-
&*
!

U
!
!
\ BMOBJ.GETFN3?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))

*
!
~

X



$

U
Ó

&

&

_
'
q


/
 
)
  HRULE.GETFNCLASSIC!
 à
?IM.INDEX.GETFN;



#
!

E

+
!
!

Ä BMOBJ.GETFN3CLASSIC



!

"

¿

!


Ä BMOBJ.GETFN3CLASSIC


.



2
#

˜ BMOBJ.GETFN3CLASSIC





¦
#IM.INDEX.GETFN(
 HRULE.GETFNCLASSIC!
W
 U
" BMOBJ.GETFN3CLASSIC


"
f


7 HRULE.GETFNCLASSIC:


/IM.INDEX.GETFN HRULE.GETFNCLASSIC!
Þ


R


y
¦

 .

 HRULE.GETFNCLASSIC


o
 

 
  0
 > L #!
 Q

L
`
X

C
!
:F BMOBJ.GETFN3
TIMESROMAN

6


>
2
˜
!


2

d


f
!
<
§zº