; S`QU*U*UPROGNCONDSTATUSNOFEATURENOLDMSGTERPRIMSGFILESPRINCPNPUTU*UjuQUOTE;Loading EXLIST 82   pSETQxDEFPROPU:U*UT+INTERNAL-STRING-MARKER xALPHALESSPLISPV2071EXLIST82VERSIONU*U.UPUSHFUNCTIONLAMBDAXORFILE-EXIT-FUNCTIONS      xFEATURETOPS-20U*U.UPUTPROPSTUDNTPSKMP.TEACHPPNTEACH!#%'%xBASEW*U*UIBASE))x~%The function "EXAMINE-LIST" is deU*U*Usigned to help you learn about list operatorU*U*Us such as CONS, CAR, CDR, and LIST. The functU*U*Uion may be invoked with one argument, in whiU*U*Uch case the value of that argument is used asU*U*U the list to be examined. If no argument is U*U*Usuplied, EXAMINE-LIST will check to see if itU*U*U has on hand another list that you have lookU*U*Ued at, and will offer to reexamine that one U*U*Ufor you (this option is chosen by typing NIL U*U*Uat that point) or will accept a new list to U*U*Uexamine.  Having gotten its argument, EXAMIU*U*UNE-LIST will first show you what its internalU*U*U representation as a tree looks like. Next U*U*Uit will tell you about how yout could have bU*U*Ueen constructed using only the CONS operator,U*U.whow it could have bg LIST.~% +-/13579;=? A!C"E#G$I%K&M'O(Q)S*U+W,Y-[.]/_0a1c2e3g4i5k6m7o8q9s:u;w<y={>}?@ABCDEFGHIJKLMNOPQRSTUV6WXYZ[\ ]^XY_Mpx xU( OUTPUTEXAMINE-LIST-DOCSUBR ,8,8K<`,x%jU*U a*OLD-LIST*The last list you looked at waU*U*Us:~   ~2% ~N~   ~2%Shall I U*Unure-examine it for you? bcdefghijk pllxl xQUERYU*UnuFRESH-LINE~&Type in a list: nopx xRECORDED-READU*U*W?HELPThat's not a list! Want help? rstpw*U*Ux x~2&Don't bother to quote it. That mU*U*Uakes it look messy...~  ~%I'll pretend yoU*Unuu didn't use quote.~% uvwxyz{|}~ px xEXAMINE-LIST-ARG-DEFAULT1+ ,8;",o4B 2 ,m+ ,8,8K<`AA ,p0+0Bq+ %,8 &=Ko'``96 +[`0B+ 3,8,8K<`0Z`[`9 ,m `,x"*UlaFunction ET being inU;]*Uvoked. a1px xPROGRAM-RECORDEXAMINE-LISTEXPLANATION-HAS-BEEN-SEEN~2&NIU*U*UL, or (), is a special thing to Maclisp. It iU*U*Us both an atom ~  ~%and an empty list. ThU*U*Ue CARCDR of NIL are both NIL! NIL is ~  ~U*U*U%alsofalse thing in Maclisp. In truth-value tU*U*wests, anything  ~%that iis true.~%        !#%'+)+-/1 3rA51p77xw;U*W7 x rstpx x~&~S is not a list!~ 9;pw*U*U==x= x%I'll pretend you didn't use quote.W;U*U~% uvwxyzh? A!C"Ep##x# xMAKE-DISPLAY-ARRAYMake-display-array fU*U*wailed. Examination of list aborted. $I%K&M'O(Q) pSSxu*U*US x~2&Pick a small for this demo or I can'tU*U*U do all my nice~  ~%display stuff on yourU;]* terminal. *U+W,Y-[.]/_0a1c2e3Epggxg xEXAMINE-NORMAL-LISTLSUBR-0  4n# @`GC M,8,8IK< 6@``W ,+,8K<`+H `7 80AA`o `0+00Bq+4 e,8,8JKog`+H ,7,8 A",<`+H[`0B` w,8 ,8KK<` ,?,8@[Ko +H $ `aG5BG ,D,8DK< ,8,8LK<`+H `D"4/,x7=#".U.USg$i?ARGS5 k6x*DISPLAY-TERMINAL*TYIU*U*UCLEAR-INPUTe any character when ready to continue.~!# 8q9s:u;wp<<x< xCLEAR-SCREENCONTINUE-DISPLAYm` 7`o ,Q,8K<` ,8,87KEKU<7`y+U ",x<Pa~&The in qU*U*Uuestion is: ~ %  ~N ~  ~%Now we'll loU*U*Uok at how that's represented inside of MaclisU*U*wp as a ~ %chain of pointers.~2% {>}?@ABCDEFGHIJpKKxK xDISPLAYPRINT-DOTTEDPRINT-CONSESPRINT-LISTS ,8,8^ f0",<`=`= `L ` `"MK@aVGOOD-LIST7 0P ` "+i `-, ` 7 8+g6@` " `Z`A@`] B`+c,xXaMAKE-FROM-LISTU(aLIST*CONS*CONS-, `d7 8+p `-, $-,0` ``4Bw[`N@N`@a-,1,X-, -,` 0 `-, BO[`N@N @0-,1,X-, -,0.U*U,x`aj~&You could have formed your lU*]nWist with LIST by:~2% PQRSTpUUxU x~N~% pw*U*UVVxV x~2&A sequence of things in list-likU*U*Um that doesn't end in NIL is~ ~%not realU*U*Uly a list, be formed withoperator LIST, so~ U*U*U%they to be made with CONS instead. (Note thaU*U*Ut it's subforms ~ may use LIST if theypropeU*U*Urly fs.) An example of ~~%this, using a subfU*U*Worm of yout, is:~  ~2%~N =>~ 2%~N~ WXYZ[\]^_ [`+abcodefghi{jk!l`mn]opq6rst%pw*U*Ux x~2&What you have typed in is not a U*U*Ut and so cannot be ~ ~%formed using LIST. A sU*U*Uequence ofgs in-like formdoesn't end in he opU*U*Uerator LIST, so(Note it'sorms  ~%lists.) YouU*U*Ur input is an example of this: =>~ ~2%~N~% uvwx6yzA{|})~Qi{r^_ [` 3kodefi{Qpjk!l`    is A ,px x` ,8,8ADK<`-,O ,8) g2N",<`7BO+ ,8,8@NK<`` ",@ + ,,8+,8gNKDK<`,xUVPaU*U*Umore compressed notaually used, called the doU*U*Utted pair~  ~%notation. Note the stuff inU*U*U parentheses is~  ~%  " . " ~ %where is theU*U*U left hand side of the tree and ~U*U*U ~%is the right hand side of the tree...~w:@   -*!#%')+-/13h579;=? 7A!C"E#G$I%K=p&&x& xPRINT-DOTTED-WORKER ,,8,8K d]<` ``M+ &@a~Sw:]nW 'pOOxO x( (pQQxQ x . )pw+]`SSxS x) *pUUxU x7 1+! A,8W,8g",<``U G,8,8,K<`[``M ,',8 YK<`Z``M U,8,8-KDK<`,xOQSU$ha7U*U*U~2&You couve fothe lith CONS by: ~~2%  ~N~2 +W,{YS-[.]]/p__x_ xPRINT-CONSES-WORKER c,8e0 X",<`,x_Ha[-,4B> `7 8+9 ` -, $-,+>[`0A@ @0-,1,X-, -,0p,x&a3;