home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| Lisp/Scheme program, ASCII text
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 63 68 61 70 74 65 72 | 7b 49 6e 74 72 6f 64 75 |\chapter|{Introdu|
|00000010| 63 74 69 6f 6e 7d 20 25 | 20 2d 2a 2d 20 44 69 63 |ction} %| -*- Dic|
|00000020| 74 69 6f 6e 61 72 79 3a | 20 64 65 73 69 67 6e 20 |tionary:| design |
|00000030| 2d 2a 2d 0a 0a 28 64 65 | 66 75 6e 20 67 76 70 20 |-*-..(de|fun gvp |
|00000040| 28 66 29 0a 20 20 28 77 | 69 74 68 2d 6f 70 65 6e |(f). (w|ith-open|
|00000050| 2d 66 69 6c 65 20 28 73 | 20 66 20 3a 64 69 72 65 |-file (s| f :dire|
|00000060| 63 74 69 6f 6e 20 3a 6f | 75 74 70 75 74 20 3a 69 |ction :o|utput :i|
|00000070| 66 2d 65 78 69 73 74 73 | 20 3a 73 75 70 65 72 73 |f-exists| :supers|
|00000080| 65 64 65 29 0a 20 20 20 | 20 28 6d 61 70 68 61 73 |ede). | (maphas|
|00000090| 68 20 5c 23 27 28 6c 61 | 6d 62 64 61 20 28 6b 20 |h \#'(la|mbda (k |
|000000a0| 76 29 0a 09 09 20 28 64 | 65 63 6c 61 72 65 20 28 |v)... (d|eclare (|
|000000b0| 69 67 6e 6f 72 65 20 76 | 29 29 0a 09 09 20 28 66 |ignore v|))... (f|
|000000c0| 6f 72 6d 61 74 20 73 20 | 22 7e 41 7e 25 22 20 6b |ormat s |"~A~%" k|
|000000d0| 29 29 0a 09 20 20 20 20 | 20 28 63 3a 3a 62 61 63 |)).. | (c::bac|
|000000e0| 6b 65 6e 64 2d 74 65 6d | 70 6c 61 74 65 2d 6e 61 |kend-tem|plate-na|
|000000f0| 6d 65 73 20 63 3a 3a 2a | 62 61 63 6b 65 6e 64 2a |mes c::*|backend*|
|00000100| 29 29 29 29 0a 0a 0c 0a | 5c 73 65 63 74 69 6f 6e |))))....|\section|
|00000110| 7b 53 63 6f 70 65 20 61 | 6e 64 20 50 75 72 70 6f |{Scope a|nd Purpo|
|00000120| 73 65 7d 0a 0a 54 68 69 | 73 20 64 6f 63 75 6d 65 |se}..Thi|s docume|
|00000130| 6e 74 20 64 65 73 63 72 | 69 62 65 73 20 74 68 65 |nt descr|ibes the|
|00000140| 20 56 69 72 74 75 61 6c | 20 4d 61 63 68 69 6e 65 | Virtual| Machine|
|00000150| 20 74 68 61 74 20 73 65 | 72 76 65 73 20 61 73 20 | that se|rves as |
|00000160| 74 68 65 20 62 61 73 69 | 73 20 66 6f 72 20 74 68 |the basi|s for th|
|00000170| 65 0a 70 6f 72 74 61 62 | 6c 65 20 69 6d 70 6c 65 |e.portab|le imple|
|00000180| 6d 65 6e 74 61 74 69 6f | 6e 20 6f 66 20 5c 63 63 |mentatio|n of \cc|
|00000190| 6c 2e 20 20 54 68 65 20 | 56 69 72 74 75 61 6c 20 |l. The |Virtual |
|000001a0| 4d 61 63 68 69 6e 65 20 | 28 68 65 72 65 61 66 74 |Machine |(hereaft|
|000001b0| 65 72 20 72 65 66 65 72 | 72 65 64 20 74 6f 20 61 |er refer|red to a|
|000001c0| 73 0a 74 68 65 20 56 4d | 29 20 70 72 6f 76 69 64 |s.the VM|) provid|
|000001d0| 65 73 20 61 20 6c 61 79 | 65 72 20 6f 66 20 61 62 |es a lay|er of ab|
|000001e0| 73 74 72 61 63 74 69 6f | 6e 20 74 68 61 74 20 68 |stractio|n that h|
|000001f0| 69 64 65 73 20 6c 6f 77 | 2d 6c 65 76 65 6c 20 64 |ides low|-level d|
|00000200| 65 74 61 69 6c 73 20 6f | 66 0a 68 61 72 64 77 61 |etails o|f.hardwa|
|00000210| 72 65 20 61 6e 64 20 69 | 6d 70 6c 65 6d 65 6e 74 |re and i|mplement|
|00000220| 61 74 69 6f 6e 20 73 74 | 72 61 74 65 67 79 2c 20 |ation st|rategy, |
|00000230| 77 68 69 6c 65 20 73 74 | 69 6c 6c 20 72 65 76 65 |while st|ill reve|
|00000240| 61 6c 69 6e 67 20 65 6e | 6f 75 67 68 20 6f 66 20 |aling en|ough of |
|00000250| 74 68 65 0a 69 6d 70 6c | 65 6d 65 6e 74 61 74 69 |the.impl|ementati|
|00000260| 6f 6e 20 73 6f 20 74 68 | 61 74 20 6d 6f 73 74 20 |on so th|at most |
|00000270| 6f 66 20 74 68 65 20 73 | 79 73 74 65 6d 20 63 61 |of the s|ystem ca|
|00000280| 6e 20 62 65 20 77 72 69 | 74 74 65 6e 20 61 74 20 |n be wri|tten at |
|00000290| 74 68 65 20 56 4d 20 6c | 65 76 65 6c 20 6f 72 0a |the VM l|evel or.|
|000002a0| 61 62 6f 76 65 2e 0a 0a | 5c 62 65 67 69 6e 7b 63 |above...|\begin{c|
|000002b0| 6f 6d 6d 65 6e 74 7d 0a | 0a 7b 5c 23 5c 23 5c 23 |omment}.|.{\#\#\#|
|000002c0| 20 53 68 6f 75 6c 64 6e | 27 74 20 73 70 65 63 69 | Shouldn|'t speci|
|000002d0| 66 79 20 56 4f 50 73 2e | 20 20 49 6e 73 74 65 61 |fy VOPs.| Instea|
|000002e0| 64 2c 20 73 68 6f 75 6c | 64 20 73 70 65 63 69 66 |d, shoul|d specif|
|000002f0| 79 20 77 68 69 63 68 20 | 5c 63 6c 69 73 70 20 66 |y which |\clisp f|
|00000300| 75 6e 63 74 69 6f 6e 73 | 0a 61 72 65 20 70 72 69 |unctions|.are pri|
|00000310| 6d 69 74 69 76 65 20 61 | 6e 64 20 77 68 69 63 68 |mitive a|nd which|
|00000320| 20 73 75 62 70 72 69 6d | 69 74 69 76 65 73 20 65 | subprim|itives e|
|00000330| 78 69 73 74 2e 20 20 49 | 73 6e 27 74 20 72 65 61 |xist. I|sn't rea|
|00000340| 6c 6c 79 20 61 6e 79 6f | 6e 65 27 73 20 62 75 73 |lly anyo|ne's bus|
|00000350| 69 6e 65 73 73 0a 77 68 | 69 63 68 20 56 4f 50 73 |iness.wh|ich VOPs|
|00000360| 20 61 63 74 75 61 6c 6c | 79 20 65 78 69 73 74 2e | actuall|y exist.|
|00000370| 20 20 45 61 63 68 20 70 | 72 69 6d 69 74 69 76 65 | Each p|rimitive|
|00000380| 20 66 75 6e 63 74 69 6f | 6e 20 6f 72 20 73 75 62 | functio|n or sub|
|00000390| 70 72 69 6d 69 74 69 76 | 65 20 69 73 0a 69 6d 70 |primitiv|e is.imp|
|000003a0| 6c 65 6d 65 6e 74 65 64 | 20 65 69 74 68 65 72 20 |lemented| either |
|000003b0| 61 73 20 61 20 56 4f 50 | 20 6f 72 20 61 73 20 65 |as a VOP| or as e|
|000003c0| 78 70 61 6e 73 69 6f 6e | 20 69 6e 74 6f 20 4c 69 |xpansion| into Li|
|000003d0| 73 70 20 63 6f 64 65 2c | 20 61 74 20 74 68 65 20 |sp code,| at the |
|000003e0| 70 61 72 74 69 63 75 6c | 61 72 0a 69 6d 70 6c 65 |particul|ar.imple|
|000003f0| 6d 65 6e 74 61 74 69 6f | 6e 27 73 20 64 69 73 63 |mentatio|n's disc|
|00000400| 72 65 74 69 6f 6e 2e 0a | 0a 46 72 6f 6d 20 74 68 |retion..|.From th|
|00000410| 69 73 20 70 6f 69 6e 74 | 20 6f 66 20 76 69 65 77 |is point| of view|
|00000420| 2c 20 74 68 65 20 64 6f | 63 75 6d 65 6e 74 20 69 |, the do|cument i|
|00000430| 73 20 65 78 70 72 65 73 | 73 69 6e 67 20 74 68 65 |s expres|sing the|
|00000440| 20 63 6f 6e 74 72 61 63 | 74 20 74 68 61 74 20 74 | contrac|t that t|
|00000450| 68 65 20 4c 69 73 70 0a | 6c 65 76 65 6c 20 63 6f |he Lisp.|level co|
|00000460| 64 65 20 6f 75 74 73 69 | 64 65 20 6f 66 20 74 68 |de outsi|de of th|
|00000470| 65 20 63 6f 6d 70 69 6c | 65 72 20 6d 75 73 74 20 |e compil|er must |
|00000480| 73 61 74 69 73 66 79 2e | 20 20 41 6c 6c 20 66 75 |satisfy.| All fu|
|00000490| 6e 63 74 69 6f 6e 73 20 | 6d 75 73 74 20 75 6c 74 |nctions |must ult|
|000004a0| 69 6d 61 74 65 6c 79 0a | 62 65 20 64 65 66 69 6e |imately.|be defin|
|000004b0| 65 64 20 69 6e 20 74 65 | 72 6d 73 20 6f 66 20 70 |ed in te|rms of p|
|000004c0| 72 69 6d 69 74 69 76 65 | 20 66 75 6e 63 74 69 6f |rimitive| functio|
|000004d0| 6e 73 20 61 6e 64 20 73 | 75 62 2d 70 72 69 6d 69 |ns and s|ub-primi|
|000004e0| 74 69 76 65 73 2e 20 20 | 0a 0a 54 68 65 20 72 65 |tives. |..The re|
|000004f0| 73 70 6f 6e 73 69 62 69 | 6c 69 74 79 20 6f 66 20 |sponsibi|lity of |
|00000500| 74 68 65 20 63 6f 6d 70 | 69 6c 65 72 20 69 73 20 |the comp|iler is |
|00000510| 74 6f 20 69 6d 70 6c 65 | 6d 65 6e 74 20 74 68 65 |to imple|ment the|
|00000520| 73 65 20 70 72 69 6d 69 | 74 69 76 65 20 6f 70 65 |se primi|tive ope|
|00000530| 72 61 74 69 6f 6e 73 2c | 0a 61 6e 64 20 61 6c 73 |rations,|.and als|
|00000540| 6f 20 74 6f 20 69 6d 70 | 6c 65 6d 65 6e 74 20 73 |o to imp|lement s|
|00000550| 70 65 63 69 61 6c 20 66 | 6f 72 6d 73 2c 20 76 61 |pecial f|orms, va|
|00000560| 72 69 61 62 6c 65 73 20 | 61 6e 64 20 66 75 6e 63 |riables |and func|
|00000570| 74 69 6f 6e 20 63 61 6c | 6c 69 6e 67 2e 0a 0a 56 |tion cal|ling...V|
|00000580| 4f 50 73 20 65 6d 69 74 | 74 65 64 20 62 79 20 74 |OPs emit|ted by t|
|00000590| 68 65 20 68 61 72 64 2d | 77 69 72 65 64 20 74 72 |he hard-|wired tr|
|000005a0| 61 6e 73 6c 61 74 6f 72 | 73 20 66 6f 72 20 6e 6f |anslator|s for no|
|000005b0| 6e 2d 66 75 6e 63 74 69 | 6f 6e 20 6e 6f 64 65 73 |n-functi|on nodes|
|000005c0| 20 61 72 65 20 61 0a 73 | 6f 6d 65 77 68 61 74 20 | are a.s|omewhat |
|000005d0| 64 69 66 66 65 72 65 6e | 74 20 73 74 6f 72 79 2e |differen|t story.|
|000005e0| 20 20 45 61 63 68 20 69 | 6d 70 6c 65 6d 65 6e 74 | Each i|mplement|
|000005f0| 61 74 69 6f 6e 20 77 69 | 6c 6c 20 70 72 65 73 75 |ation wi|ll presu|
|00000600| 6d 61 62 6c 79 20 69 6d | 70 6c 65 6d 65 6e 74 20 |mably im|plement |
|00000610| 61 6c 6c 0a 74 68 65 73 | 65 20 56 4f 50 73 20 69 |all.thes|e VOPs i|
|00000620| 6e 20 6f 72 64 65 72 20 | 74 6f 20 61 76 6f 69 64 |n order |to avoid|
|00000630| 20 68 61 76 69 6e 67 20 | 74 6f 20 72 65 77 72 69 | having |to rewri|
|00000640| 74 65 20 49 52 32 20 74 | 72 61 6e 73 6c 61 74 69 |te IR2 t|ranslati|
|00000650| 6f 6e 2e 20 20 57 65 20 | 61 6c 73 6f 20 6e 65 65 |on. We |also nee|
|00000660| 64 0a 74 6f 20 73 70 65 | 6e 64 20 71 75 69 74 65 |d.to spe|nd quite|
|00000670| 20 61 20 62 69 74 20 6f | 66 20 74 69 6d 65 20 64 | a bit o|f time d|
|00000680| 69 73 63 75 73 73 69 6e | 67 20 74 68 65 20 73 65 |iscussin|g the se|
|00000690| 6d 61 6e 74 69 63 73 20 | 6f 66 20 74 68 65 73 65 |mantics |of these|
|000006a0| 20 6f 70 65 72 61 74 69 | 6f 6e 73 2c 0a 73 69 6e | operati|ons,.sin|
|000006b0| 63 65 20 74 68 65 79 20 | 64 6f 6e 27 74 20 6a 75 |ce they |don't ju|
|000006c0| 73 74 20 63 6f 72 72 65 | 73 70 6f 6e 64 20 74 6f |st corre|spond to|
|000006d0| 20 73 6f 6d 65 20 5c 63 | 6c 69 73 70 20 66 75 6e | some \c|lisp fun|
|000006e0| 63 74 69 6f 6e 20 77 69 | 74 68 20 74 79 70 65 20 |ction wi|th type |
|000006f0| 63 6f 6e 73 74 72 61 69 | 6e 74 73 2e 0a 0a 48 61 |constrai|nts...Ha|
|00000700| 72 64 2d 77 69 72 65 64 | 20 73 74 75 66 66 3a 0a |rd-wired| stuff:.|
|00000710| 0a 66 75 6e 63 74 69 6f | 6e 20 63 61 6c 6c 0a 76 |.functio|n call.v|
|00000720| 61 72 69 61 62 6c 65 20 | 61 63 63 65 73 73 3a 0a |ariable |access:.|
|00000730| 20 20 67 6c 6f 62 61 6c | 0a 20 20 66 75 6e 63 74 | global|. funct|
|00000740| 69 6f 6e 0a 20 20 63 6f | 6e 73 74 61 6e 74 0a 20 |ion. co|nstant. |
|00000750| 20 63 6c 6f 73 75 72 65 | 0a 20 20 6c 6f 63 61 6c | closure|. local|
|00000760| 0a 63 6c 6f 73 75 72 65 | 20 63 72 65 61 74 69 6f |.closure| creatio|
|00000770| 6e 0a 6e 6f 6e 2d 6c 6f | 63 61 6c 20 65 78 69 74 |n.non-lo|cal exit|
|00000780| 0a 73 70 65 63 69 61 6c | 20 62 69 6e 64 69 6e 67 |.special| binding|
|00000790| 2f 75 6e 62 69 6e 64 69 | 6e 67 0a 54 4e 20 68 61 |/unbindi|ng.TN ha|
|000007a0| 63 6b 69 6e 67 3a 0a 20 | 20 6d 6f 76 65 20 56 4f |cking:. | move VO|
|000007b0| 50 73 0a 20 20 54 4e 20 | 61 64 64 72 65 73 73 20 |Ps. TN |address |
|000007c0| 28 3f 3f 3f 29 0a 43 6f | 6e 64 69 74 69 6f 6e 61 |(???).Co|nditiona|
|000007d0| 6c 73 3a 0a 20 20 42 61 | 73 69 63 20 63 6f 6e 64 |ls:. Ba|sic cond|
|000007e0| 69 74 69 6f 6e 61 6c 73 | 3a 20 45 51 2c 20 2e 2e |itionals|: EQ, ..|
|000007f0| 2e 0a 20 20 49 6e 74 65 | 72 66 61 63 65 20 74 6f |.. Inte|rface to|
|00000800| 20 67 65 6e 65 72 61 74 | 69 6f 6e 20 6f 66 20 6f | generat|ion of o|
|00000810| 74 68 65 72 20 63 6f 6e | 64 69 74 69 6f 6e 61 6c |ther con|ditional|
|00000820| 20 56 4f 50 73 2e 0a 0a | 53 6f 6d 65 20 56 4f 50 | VOPs...|Some VOP|
|00000830| 73 20 64 6f 6e 27 74 20 | 6e 65 65 64 20 74 6f 20 |s don't |need to |
|00000840| 62 65 20 69 6d 70 6c 65 | 6d 65 6e 74 65 64 20 61 |be imple|mented a|
|00000850| 74 20 61 6c 6c 3a 0a 20 | 20 56 4f 50 73 20 74 6f |t all:. | VOPs to|
|00000860| 20 64 65 6c 69 6d 69 74 | 20 74 68 65 20 6c 69 66 | delimit| the lif|
|00000870| 65 74 69 6d 65 73 20 6f | 66 20 62 69 67 20 73 74 |etimes o|f big st|
|00000880| 61 63 6b 20 54 4e 73 20 | 73 75 63 68 20 61 73 20 |ack TNs |such as |
|00000890| 63 61 74 63 68 20 62 6c | 6f 63 6b 73 0a 20 20 4f |catch bl|ocks. O|
|000008a0| 74 68 65 72 73 3f 20 20 | 4d 6f 76 65 20 56 4f 50 |thers? |Move VOP|
|000008b0| 73 20 6d 69 67 68 74 20 | 62 65 20 64 65 66 69 6e |s might |be defin|
|000008c0| 65 64 20 69 6e 20 74 65 | 72 6d 73 20 6f 66 20 61 |ed in te|rms of a|
|000008d0| 6e 20 69 6d 70 6c 65 6d | 65 6e 74 61 74 69 6f 6e |n implem|entation|
|000008e0| 20 73 75 70 70 6c 69 65 | 64 0a 20 20 6d 6f 76 65 | supplie|d. move|
|000008f0| 20 72 6f 75 74 69 6e 65 | 2c 20 73 69 6e 63 65 20 | routine|, since |
|00000900| 77 65 20 70 72 6f 62 61 | 62 6c 79 20 61 6c 73 6f |we proba|bly also|
|00000910| 20 6e 65 65 64 20 74 68 | 69 73 20 69 6e 66 6f 20 | need th|is info |
|00000920| 6f 75 74 73 69 64 65 20 | 6f 66 20 56 4f 50 20 67 |outside |of VOP g|
|00000930| 65 6e 65 72 61 74 6f 72 | 73 0a 20 20 73 6f 20 74 |enerator|s. so t|
|00000940| 68 61 74 20 69 6d 70 6c | 69 63 69 74 20 6d 6f 76 |hat impl|icit mov|
|00000950| 65 73 20 63 61 6e 20 62 | 65 20 67 65 6e 65 72 61 |es can b|e genera|
|00000960| 74 65 64 2e 0a 0a 0a 54 | 79 70 65 20 74 65 73 74 |ted....T|ype test|
|00000970| 69 6e 67 2f 63 68 65 63 | 6b 69 6e 67 20 28 73 6f |ing/chec|king (so|
|00000980| 6d 65 68 6f 77 29 0a 0a | 7d 0a 0a 57 68 61 74 20 |mehow)..|}..What |
|00000990| 74 68 69 73 20 64 6f 63 | 75 6d 65 6e 74 20 74 61 |this doc|ument ta|
|000009a0| 6c 6b 73 20 61 62 6f 75 | 74 3a 0a 0a 49 6e 74 65 |lks abou|t:..Inte|
|000009b0| 72 66 61 63 65 20 62 65 | 74 77 65 65 6e 20 63 6f |rface be|tween co|
|000009c0| 6d 70 69 6c 65 72 20 66 | 72 6f 6e 74 2d 65 6e 64 |mpiler f|ront-end|
|000009d0| 20 61 6e 64 20 62 61 63 | 6b 20 65 6e 64 2e 20 28 | and bac|k end. (|
|000009e0| 56 4f 50 73 29 0a 20 20 | 20 50 72 69 6d 69 74 69 |VOPs). | Primiti|
|000009f0| 76 65 20 5c 63 6c 69 73 | 70 20 6f 70 65 72 61 74 |ve \clis|p operat|
|00000a00| 69 6f 6e 73 20 64 69 72 | 65 63 74 6c 79 20 73 75 |ions dir|ectly su|
|00000a10| 70 70 6f 72 74 65 64 20 | 62 79 20 74 68 65 20 56 |pported |by the V|
|00000a20| 4d 2e 0a 20 20 20 53 75 | 70 70 6f 72 74 20 66 6f |M.. Su|pport fo|
|00000a30| 72 20 63 6f 6d 70 6c 65 | 78 20 6c 61 6e 67 75 61 |r comple|x langua|
|00000a40| 67 65 20 66 65 61 74 75 | 72 65 73 20 73 75 63 68 |ge featu|res such|
|00000a50| 20 61 73 20 66 75 6e 63 | 74 69 6f 6e 20 63 61 6c | as func|tion cal|
|00000a60| 6c 2e 0a 0a 53 75 62 2d | 70 72 69 6d 69 74 69 76 |l...Sub-|primitiv|
|00000a70| 65 73 20 74 68 61 74 20 | 61 6c 6c 6f 77 20 73 79 |es that |allow sy|
|00000a80| 73 74 65 6d 20 63 6f 64 | 65 20 74 6f 20 64 6f 20 |stem cod|e to do |
|00000a90| 74 68 69 6e 67 73 20 6e | 6f 74 20 70 6f 73 73 69 |things n|ot possi|
|00000aa0| 62 6c 65 20 69 6e 20 5c | 63 6c 69 73 70 2e 0a 0a |ble in \|clisp...|
|00000ab0| 44 65 73 63 72 69 70 74 | 69 6f 6e 73 20 6f 66 20 |Descript|ions of |
|00000ac0| 68 6f 77 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |how the |current |
|00000ad0| 5c 63 63 6c 20 73 79 73 | 74 65 6d 20 75 73 65 73 |\ccl sys|tem uses|
|00000ae0| 20 56 4d 20 66 61 63 69 | 6c 69 74 69 65 73 2c 20 | VM faci|lities, |
|00000af0| 65 73 70 65 63 69 61 6c | 6c 79 0a 6e 6f 6e 2d 73 |especial|ly.non-s|
|00000b00| 74 61 6e 64 61 72 64 20 | 6f 6e 65 73 20 61 63 63 |tandard |ones acc|
|00000b10| 65 73 73 65 64 20 74 68 | 72 6f 75 67 68 20 73 75 |essed th|rough su|
|00000b20| 62 2d 70 72 69 6d 69 74 | 69 76 65 73 2e 0a 0a 4e |b-primit|ives...N|
|00000b30| 6f 74 65 73 20 61 62 6f | 75 74 20 6b 6e 6f 77 6e |otes abo|ut known|
|00000b40| 20 70 6f 72 74 61 62 69 | 6c 69 74 79 20 70 72 6f | portabi|lity pro|
|00000b50| 62 6c 65 6d 73 2e 0a 0a | 47 75 69 64 65 6c 69 6e |blems...|Guidelin|
|00000b60| 65 73 20 66 6f 72 20 77 | 72 69 74 69 6e 67 20 70 |es for w|riting p|
|00000b70| 6f 72 74 61 62 6c 65 20 | 5c 63 63 6c 20 73 79 73 |ortable |\ccl sys|
|00000b80| 74 65 6d 20 63 6f 64 65 | 2e 20 20 54 6f 20 73 6f |tem code|. To so|
|00000b90| 6d 65 20 64 65 67 72 65 | 65 20 74 68 65 73 65 0a |me degre|e these.|
|00000ba0| 67 75 69 64 65 6c 69 6e | 65 73 20 61 72 65 20 69 |guidelin|es are i|
|00000bb0| 6d 70 6c 69 65 64 20 62 | 79 20 73 74 61 74 65 6d |mplied b|y statem|
|00000bc0| 65 6e 74 73 20 74 68 61 | 74 20 63 65 72 74 61 69 |ents tha|t certai|
|00000bd0| 6e 20 74 68 69 6e 67 73 | 20 61 72 65 20 74 72 75 |n things| are tru|
|00000be0| 65 20 6f 66 20 5c 63 63 | 6c 0a 73 79 73 74 65 6d |e of \cc|l.system|
|00000bf0| 20 63 6f 64 65 2e 0a 0a | 44 65 73 63 72 69 70 74 | code...|Descript|
|00000c00| 69 6f 6e 73 20 6f 66 20 | 64 61 74 61 20 73 74 72 |ions of |data str|
|00000c10| 75 63 74 75 72 65 73 20 | 74 68 61 74 20 61 72 65 |uctures |that are|
|00000c20| 20 6e 6f 74 20 64 69 72 | 65 63 74 6c 79 20 75 73 | not dir|ectly us|
|00000c30| 65 64 20 62 79 20 74 68 | 65 20 56 4d 2c 20 73 75 |ed by th|e VM, su|
|00000c40| 63 68 20 61 73 0a 64 65 | 62 75 67 20 69 6e 66 6f |ch as.de|bug info|
|00000c50| 72 6d 61 74 69 6f 6e 20 | 61 6e 64 20 43 6f 72 65 |rmation |and Core|
|00000c60| 20 66 69 6c 65 73 2e 0a | 0a 44 65 73 63 72 69 70 | files..|.Descrip|
|00000c70| 74 69 6f 6e 73 20 6f 66 | 20 64 61 74 61 20 73 74 |tions of| data st|
|00000c80| 72 75 63 74 75 72 65 73 | 20 74 68 61 74 20 61 72 |ructures| that ar|
|00000c90| 65 20 64 69 72 65 63 74 | 6c 79 20 75 73 65 64 20 |e direct|ly used |
|00000ca0| 62 79 20 74 68 65 20 56 | 4d 2c 20 73 75 63 68 20 |by the V|M, such |
|00000cb0| 61 73 0a 73 79 6d 62 6f | 6c 73 20 61 6e 64 20 61 |as.symbo|ls and a|
|00000cc0| 72 72 61 79 73 2e 0a 0a | 0a 57 68 6f 20 73 68 6f |rrays...|.Who sho|
|00000cd0| 75 6c 64 20 72 65 61 64 | 20 69 74 3a 0a 0a 50 65 |uld read| it:..Pe|
|00000ce0| 6f 70 6c 65 20 77 68 6f | 20 77 61 6e 74 20 74 6f |ople who| want to|
|00000cf0| 20 70 6f 72 74 20 5c 63 | 63 6c 2e 0a 50 65 6f 70 | port \c|cl..Peop|
|00000d00| 6c 65 20 77 68 6f 20 77 | 61 6e 74 20 74 6f 20 75 |le who w|ant to u|
|00000d10| 6e 64 65 72 73 74 61 6e | 64 20 74 68 65 20 63 6f |nderstan|d the co|
|00000d20| 6d 70 69 6c 65 72 2e 0a | 50 65 6f 70 6c 65 20 77 |mpiler..|People w|
|00000d30| 68 6f 20 77 61 6e 74 20 | 74 6f 20 75 6e 64 65 72 |ho want |to under|
|00000d40| 73 74 61 6e 64 20 68 6f | 77 20 5c 63 63 6c 20 77 |stand ho|w \ccl w|
|00000d50| 6f 72 6b 73 2e 0a 50 65 | 6f 70 6c 65 20 77 68 6f |orks..Pe|ople who|
|00000d60| 20 6e 65 65 64 20 74 6f | 20 77 72 69 74 65 20 70 | need to| write p|
|00000d70| 6f 72 74 61 62 6c 65 20 | 5c 63 63 6c 20 73 79 73 |ortable |\ccl sys|
|00000d80| 74 65 6d 20 63 6f 64 65 | 2e 0a 50 65 6f 70 6c 65 |tem code|..People|
|00000d90| 20 73 75 63 68 20 61 73 | 20 64 65 62 75 67 67 65 | such as| debugge|
|00000da0| 72 20 77 72 69 74 65 72 | 73 20 77 68 6f 20 6e 65 |r writer|s who ne|
|00000db0| 65 64 20 74 6f 20 61 63 | 63 65 73 73 20 5c 63 63 |ed to ac|cess \cc|
|00000dc0| 6c 5c 74 28 29 27 73 20 | 69 6e 74 65 72 6e 61 6c |l\t()'s |internal|
|00000dd0| 20 64 61 74 61 0a 73 74 | 72 75 63 74 75 72 65 73 | data.st|ructures|
|00000de0| 2e 0a 0a 57 68 61 74 20 | 69 74 20 77 6f 6e 27 74 |...What |it won't|
|00000df0| 20 64 6f 3a 0a 0a 54 65 | 6c 6c 20 79 6f 75 20 74 | do:..Te|ll you t|
|00000e00| 68 69 6e 67 73 20 74 68 | 61 74 20 61 72 65 20 6f |hings th|at are o|
|00000e10| 62 76 69 6f 75 73 6c 79 | 20 69 6d 70 6c 65 6d 65 |bviously| impleme|
|00000e20| 6e 74 61 74 69 6f 6e 20 | 64 65 70 65 6e 64 65 6e |ntation |dependen|
|00000e30| 74 2c 20 73 75 63 68 20 | 61 73 20 74 79 70 65 0a |t, such |as type.|
|00000e40| 73 79 73 74 65 6d 73 20 | 6f 72 20 6d 65 6d 6f 72 |systems |or memor|
|00000e50| 79 20 6d 61 6e 61 67 65 | 6d 65 6e 74 20 64 69 73 |y manage|ment dis|
|00000e60| 63 69 70 6c 69 6e 65 73 | 2e 20 20 53 65 65 20 74 |ciplines|. See t|
|00000e70| 68 65 20 74 68 65 20 76 | 61 72 69 6f 75 73 20 69 |he the v|arious i|
|00000e80| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 0a 56 4d |mplement|ation.VM|
|00000e90| 20 64 6f 63 75 6d 65 6e | 74 73 2e 0a 0a 54 65 6c | documen|ts...Tel|
|00000ea0| 6c 20 79 6f 75 20 6f 6e | 6c 79 20 77 68 61 74 20 |l you on|ly what |
|00000eb0| 79 6f 75 20 6e 65 65 64 | 20 74 6f 20 6b 6e 6f 77 |you need| to know|
|00000ec0| 2e 20 20 50 72 6f 67 72 | 61 6d 6d 65 72 73 20 73 |. Progr|ammers s|
|00000ed0| 68 6f 75 6c 64 6e 27 74 | 20 65 78 70 6c 6f 69 74 |houldn't| exploit|
|00000ee0| 20 70 72 6f 70 65 72 74 | 69 65 73 0a 6f 66 20 74 | propert|ies.of t|
|00000ef0| 68 65 20 56 4d 20 64 6f | 63 75 6d 65 6e 74 65 64 |he VM do|cumented|
|00000f00| 20 68 65 72 65 20 75 6e | 6c 65 73 73 20 74 68 65 | here un|less the|
|00000f10| 72 65 20 69 73 20 6e 6f | 20 77 61 79 20 74 6f 20 |re is no| way to |
|00000f20| 64 6f 20 74 68 65 20 73 | 61 6d 65 20 74 68 69 6e |do the s|ame thin|
|00000f30| 67 20 69 6e 0a 70 6f 72 | 74 61 62 6c 65 20 5c 63 |g in.por|table \c|
|00000f40| 6c 69 73 70 2e 0a 0a 54 | 65 6c 6c 20 79 6f 75 20 |lisp...T|ell you |
|00000f50| 68 6f 77 20 74 68 65 20 | 63 6f 6d 70 69 6c 65 72 |how the |compiler|
|00000f60| 20 77 6f 72 6b 73 2e 20 | 20 49 6e 20 6f 72 64 65 | works. | In orde|
|00000f70| 72 20 74 6f 20 75 6e 64 | 65 72 73 74 61 6e 64 20 |r to und|erstand |
|00000f80| 73 6f 6d 65 20 6f 66 20 | 74 68 65 20 73 75 62 74 |some of |the subt|
|00000f90| 6c 65 74 69 65 73 0a 6f | 66 20 56 4f 50 20 64 65 |leties.o|f VOP de|
|00000fa0| 73 63 72 69 70 74 69 6f | 6e 73 2c 20 79 6f 75 20 |scriptio|ns, you |
|00000fb0| 77 69 6c 6c 20 68 61 76 | 65 20 74 6f 20 75 6e 64 |will hav|e to und|
|00000fc0| 65 72 73 74 61 6e 64 20 | 74 68 65 20 49 52 32 20 |erstand |the IR2 |
|00000fd0| 72 65 70 72 65 73 65 6e | 74 61 74 69 6f 6e 20 61 |represen|tation a|
|00000fe0| 6e 64 20 68 6f 77 0a 69 | 74 20 66 69 74 73 20 69 |nd how.i|t fits i|
|00000ff0| 6e 74 6f 20 74 68 65 20 | 72 65 73 74 20 6f 66 20 |nto the |rest of |
|00001000| 74 68 65 20 63 6f 6d 70 | 69 6c 65 72 2e 0a 0a 54 |the comp|iler...T|
|00001010| 65 6c 6c 20 79 6f 75 20 | 61 6e 79 74 68 69 6e 67 |ell you |anything|
|00001020| 20 61 62 6f 75 74 20 5c | 63 6c 69 73 70 20 73 65 | about \|clisp se|
|00001030| 6d 61 6e 74 69 63 73 2e | 20 20 57 68 65 6e 20 73 |mantics.| When s|
|00001040| 6f 6d 65 20 70 61 72 74 | 20 6f 66 20 74 68 65 20 |ome part| of the |
|00001050| 56 4d 20 68 61 73 20 61 | 0a 64 69 72 65 63 74 20 |VM has a|.direct |
|00001060| 72 65 6c 61 74 69 6f 6e | 73 68 69 70 20 74 6f 20 |relation|ship to |
|00001070| 5c 63 6c 69 73 70 20 73 | 65 6d 61 6e 74 69 63 73 |\clisp s|emantics|
|00001080| 2c 20 74 68 65 20 72 65 | 6c 61 74 69 6f 6e 73 68 |, the re|lationsh|
|00001090| 69 70 20 77 69 6c 6c 20 | 62 65 20 64 69 72 65 63 |ip will |be direc|
|000010a0| 74 6c 79 0a 73 74 61 74 | 65 64 20 75 73 69 6e 67 |tly.stat|ed using|
|000010b0| 20 5c 63 6c 69 73 70 20 | 74 65 72 6d 69 6e 6f 6c | \clisp |terminol|
|000010c0| 6f 67 79 2c 20 73 69 6e | 63 65 20 61 20 72 65 73 |ogy, sin|ce a res|
|000010d0| 74 61 74 65 6d 65 6e 74 | 20 6f 66 20 74 68 65 20 |tatement| of the |
|000010e0| 73 65 6d 61 6e 74 69 63 | 73 20 69 73 20 6c 69 6b |semantic|s is lik|
|000010f0| 65 6c 79 0a 74 6f 20 62 | 65 20 69 6e 61 63 63 75 |ely.to b|e inaccu|
|00001100| 72 61 74 65 20 6f 72 20 | 6d 69 73 6c 65 61 64 69 |rate or |misleadi|
|00001110| 6e 67 2e 20 20 45 78 63 | 65 70 74 69 6f 6e 73 20 |ng. Exc|eptions |
|00001120| 77 69 6c 6c 20 62 65 20 | 6d 61 64 65 20 6f 6e 6c |will be |made onl|
|00001130| 79 20 77 68 65 6e 20 73 | 6f 6d 65 0a 69 6d 70 6c |y when s|ome.impl|
|00001140| 69 63 61 74 69 6f 6e 20 | 6f 66 20 74 68 65 20 5c |ication |of the \|
|00001150| 63 6c 69 73 70 20 73 65 | 6d 61 6e 74 69 63 73 20 |clisp se|mantics |
|00001160| 69 73 20 6e 6f 6e 2d 6f | 62 76 69 6f 75 73 2e 0a |is non-o|bvious..|
|00001170| 0a 54 65 6c 6c 20 79 6f | 75 20 65 76 65 72 79 74 |.Tell yo|u everyt|
|00001180| 68 69 6e 67 20 61 62 6f | 75 74 20 68 6f 77 20 5c |hing abo|ut how \|
|00001190| 63 63 6c 20 77 6f 72 6b | 73 2e 20 20 54 68 69 73 |ccl work|s. This|
|000011a0| 20 64 6f 63 75 6d 65 6e | 74 20 6f 6e 6c 79 20 6f | documen|t only o|
|000011b0| 66 66 65 72 73 0a 69 6e | 66 6f 72 6d 61 74 69 6f |ffers.in|formatio|
|000011c0| 6e 20 74 68 61 74 20 69 | 73 20 6c 69 6b 65 6c 79 |n that i|s likely|
|000011d0| 20 74 6f 20 62 65 20 6e | 65 65 64 65 64 20 62 79 | to be n|eeded by|
|000011e0| 20 70 72 6f 67 72 61 6d | 6d 65 72 73 20 64 6f 69 | program|mers doi|
|000011f0| 6e 67 20 61 20 70 6f 72 | 74 20 6f 72 20 77 72 69 |ng a por|t or wri|
|00001200| 74 69 6e 67 0a 73 79 73 | 74 65 6d 20 63 6f 64 65 |ting.sys|tem code|
|00001210| 3b 20 70 6f 72 74 61 62 | 6c 65 2c 20 73 65 6c 66 |; portab|le, self|
|00001220| 2d 63 6f 6e 74 61 69 6e | 65 64 20 70 61 72 74 73 |-contain|ed parts|
|00001230| 20 6f 66 20 74 68 65 20 | 73 79 73 74 65 6d 20 61 | of the |system a|
|00001240| 72 65 20 74 6f 74 61 6c | 6c 79 20 69 67 6e 6f 72 |re total|ly ignor|
|00001250| 65 64 2e 0a 54 68 69 73 | 20 64 6f 63 75 6d 65 6e |ed..This| documen|
|00001260| 74 20 64 65 6c 69 62 65 | 72 61 74 65 6c 79 20 61 |t delibe|rately a|
|00001270| 76 6f 69 64 73 20 72 65 | 70 6c 69 63 61 74 69 6e |voids re|plicatin|
|00001280| 67 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 74 68 |g inform|ation th|
|00001290| 61 74 20 69 73 20 65 61 | 73 69 6c 79 0a 61 76 61 |at is ea|sily.ava|
|000012a0| 69 6c 61 62 6c 65 20 69 | 6e 20 74 68 65 20 73 79 |ilable i|n the sy|
|000012b0| 73 74 65 6d 20 73 6f 75 | 72 63 65 73 2c 20 73 69 |stem sou|rces, si|
|000012c0| 6e 63 65 20 73 75 63 68 | 20 72 65 70 6c 69 63 61 |nce such| replica|
|000012d0| 74 65 64 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |ted info|rmation |
|000012e0| 69 73 20 61 6c 77 61 79 | 73 0a 69 6e 63 6f 72 72 |is alway|s.incorr|
|000012f0| 65 63 74 20 73 6f 6d 65 | 77 68 65 72 65 2e 20 20 |ect some|where. |
|00001300| 49 6e 20 73 6f 6d 65 20 | 63 61 73 65 73 2c 20 61 |In some |cases, a|
|00001310| 20 66 6f 72 77 61 72 64 | 69 6e 67 20 70 6f 69 6e | forward|ing poin|
|00001320| 74 65 72 20 74 6f 20 74 | 68 65 20 61 70 70 72 6f |ter to t|he appro|
|00001330| 70 72 69 61 74 65 0a 73 | 6f 75 72 63 65 20 77 69 |priate.s|ource wi|
|00001340| 6c 6c 20 62 65 20 67 69 | 76 65 6e 2e 0a 0a 0a 54 |ll be gi|ven....T|
|00001350| 68 69 6e 67 73 20 74 68 | 65 20 56 4d 20 77 6f 6e |hings th|e VM won|
|00001360| 27 74 20 64 6f 3a 0a 0a | 54 68 65 20 56 4d 20 73 |'t do:..|The VM s|
|00001370| 70 65 63 69 66 69 63 61 | 74 69 6f 6e 20 64 6f 65 |pecifica|tion doe|
|00001380| 73 20 6e 6f 74 20 74 6f | 74 61 6c 6c 79 20 73 6f |s not to|tally so|
|00001390| 6c 76 65 20 74 68 65 20 | 70 72 6f 62 6c 65 6d 20 |lve the |problem |
|000013a0| 6f 66 20 70 6f 72 74 69 | 6e 67 20 5c 63 63 6c 2c |of porti|ng \ccl,|
|000013b0| 20 73 69 6e 63 65 0a 69 | 74 20 69 73 20 69 6e 65 | since.i|t is ine|
|000013c0| 76 69 74 61 62 6c 65 20 | 74 68 61 74 20 69 74 20 |vitable |that it |
|000013d0| 77 69 6c 6c 20 6e 6f 74 | 20 6d 61 70 20 63 6c 65 |will not| map cle|
|000013e0| 61 6e 6c 79 20 74 6f 20 | 61 6c 6c 20 70 6f 73 73 |anly to |all poss|
|000013f0| 69 62 6c 65 20 63 6f 6d | 62 69 6e 61 74 69 6f 6e |ible com|bination|
|00001400| 73 20 6f 66 0a 68 61 72 | 64 77 61 72 65 20 61 6e |s of.har|dware an|
|00001410| 64 20 6f 70 65 72 61 74 | 69 6e 67 20 73 79 73 74 |d operat|ing syst|
|00001420| 65 6d 73 2e 20 20 54 68 | 65 20 56 4d 20 73 68 6f |ems. Th|e VM sho|
|00001430| 75 6c 64 20 6e 6f 74 20 | 62 65 20 72 65 67 61 72 |uld not |be regar|
|00001440| 64 65 64 20 61 73 20 62 | 65 69 6e 67 20 63 61 73 |ded as b|eing cas|
|00001450| 74 20 69 6e 0a 63 6f 6e | 63 72 65 74 65 2c 20 73 |t in.con|crete, s|
|00001460| 69 6e 63 65 20 63 68 61 | 6e 67 65 73 20 69 6e 20 |ince cha|nges in |
|00001470| 6d 61 6e 79 20 63 68 61 | 72 61 63 74 65 72 69 73 |many cha|racteris|
|00001480| 74 69 63 73 20 77 6f 75 | 6c 64 20 6f 6e 6c 79 20 |tics wou|ld only |
|00001490| 61 66 66 65 63 74 20 61 | 20 74 69 6e 79 0a 66 72 |affect a| tiny.fr|
|000014a0| 61 63 74 69 6f 6e 20 6f | 66 20 74 68 65 20 73 79 |action o|f the sy|
|000014b0| 73 74 65 6d 20 73 6f 75 | 72 63 65 73 2e 0a 0a 4f |stem sou|rces...O|
|000014c0| 6e 65 20 63 75 72 72 65 | 6e 74 20 6d 61 6a 6f 72 |ne curre|nt major|
|000014d0| 20 70 72 6f 62 6c 65 6d | 20 77 69 74 68 20 70 6f | problem| with po|
|000014e0| 72 74 69 6e 67 20 69 73 | 20 74 68 61 74 20 6c 61 |rting is| that la|
|000014f0| 72 67 65 20 70 69 65 63 | 65 73 20 6f 66 20 66 75 |rge piec|es of fu|
|00001500| 6e 63 74 69 6f 6e 61 6c | 69 74 79 0a 61 72 65 20 |nctional|ity.are |
|00001510| 65 6e 74 69 72 65 6c 79 | 20 77 69 74 68 69 6e 20 |entirely| within |
|00001520| 74 68 65 20 56 4d 2c 20 | 61 6e 64 20 77 6f 75 6c |the VM, |and woul|
|00001530| 64 20 6e 65 65 64 20 74 | 6f 20 62 65 20 72 65 69 |d need t|o be rei|
|00001540| 6d 70 6c 65 6d 65 6e 74 | 65 64 20 66 6f 72 20 65 |mplement|ed for e|
|00001550| 61 63 68 20 70 6f 72 74 | 2e 0a 41 20 6d 61 6a 6f |ach port|..A majo|
|00001560| 72 20 67 6f 61 6c 20 66 | 6f 72 20 66 75 74 75 72 |r goal f|or futur|
|00001570| 65 20 77 6f 72 6b 20 6f | 6e 20 74 68 65 20 73 79 |e work o|n the sy|
|00001580| 73 74 65 6d 20 69 73 20 | 6d 6f 76 69 6e 67 20 63 |stem is |moving c|
|00001590| 6f 64 65 20 6f 75 74 20 | 6f 66 20 74 68 65 20 56 |ode out |of the V|
|000015a0| 4d 2c 20 62 6f 74 68 0a | 62 79 20 73 75 70 70 6f |M, both.|by suppo|
|000015b0| 72 74 69 6e 67 20 61 20 | 22 66 61 73 74 2d 63 61 |rting a |"fast-ca|
|000015c0| 6c 6c 22 20 63 6f 6e 76 | 65 6e 74 69 6f 6e 20 74 |ll" conv|ention t|
|000015d0| 68 61 74 20 61 6c 6c 6f | 77 73 20 72 65 61 73 6f |hat allo|ws reaso|
|000015e0| 6e 61 62 6c 65 20 75 73 | 65 20 6f 66 20 4c 69 73 |nable us|e of Lis|
|000015f0| 70 20 69 6e 0a 74 68 65 | 20 6f 75 74 20 6f 66 20 |p in.the| out of |
|00001600| 6c 69 6e 65 20 69 6d 70 | 6c 65 6d 65 6e 74 61 74 |line imp|lementat|
|00001610| 69 6f 6e 20 6f 66 20 56 | 4f 50 73 2c 20 61 6e 64 |ion of V|OPs, and|
|00001620| 20 62 79 20 68 61 76 69 | 6e 67 20 61 20 22 62 75 | by havi|ng a "bu|
|00001630| 67 6f 75 74 22 20 6d 65 | 63 68 61 6e 69 73 6d 20 |gout" me|chanism |
|00001640| 74 68 61 74 0a 61 6c 6c | 6f 77 73 20 74 68 65 20 |that.all|ows the |
|00001650| 56 4d 20 74 6f 20 63 61 | 6c 6c 20 4c 69 73 70 20 |VM to ca|ll Lisp |
|00001660| 66 75 6e 63 74 69 6f 6e | 73 20 74 6f 20 69 6d 70 |function|s to imp|
|00001670| 6c 65 6d 65 6e 74 20 74 | 68 65 20 68 61 72 64 20 |lement t|he hard |
|00001680| 63 61 73 65 73 20 69 6e | 20 73 6f 6d 65 20 56 4f |cases in| some VO|
|00001690| 50 73 2e 0a 0a 54 68 65 | 20 56 4d 20 69 73 20 64 |Ps...The| VM is d|
|000016a0| 65 73 69 67 6e 65 64 20 | 74 6f 20 73 75 70 70 6f |esigned |to suppo|
|000016b0| 72 74 20 63 6f 6e 76 65 | 6e 74 69 6f 6e 61 6c 2c |rt conve|ntional,|
|000016c0| 20 75 6e 74 61 67 67 65 | 64 2c 20 67 65 6e 65 72 | untagge|d, gener|
|000016d0| 61 6c 20 72 65 67 69 73 | 74 65 72 0a 61 72 63 68 |al regis|ter.arch|
|000016e0| 69 74 65 63 74 75 72 65 | 73 2e 20 20 53 75 69 74 |itecture|s. Suit|
|000016f0| 61 62 6c 79 20 6c 6f 62 | 6f 74 6f 6d 69 7a 65 64 |ably lob|otomized|
|00001700| 2c 20 69 74 20 63 6f 75 | 6c 64 20 62 65 20 6d 61 |, it cou|ld be ma|
|00001710| 70 70 65 64 20 74 6f 20 | 6c 65 73 73 20 66 6c 65 |pped to |less fle|
|00001720| 78 69 62 6c 65 0a 68 61 | 72 64 77 61 72 65 20 73 |xible.ha|rdware s|
|00001730| 75 63 68 20 61 73 20 22 | 4c 69 73 70 20 6d 61 63 |uch as "|Lisp mac|
|00001740| 68 69 6e 65 73 22 2c 20 | 62 75 74 20 74 68 65 20 |hines", |but the |
|00001750| 63 6f 6d 70 69 6c 65 72 | 20 77 6f 75 6c 64 20 68 |compiler| would h|
|00001760| 61 76 65 20 73 65 72 69 | 6f 75 73 0a 64 69 66 66 |ave seri|ous.diff|
|00001770| 69 63 75 6c 74 69 65 73 | 20 73 75 70 70 6f 72 74 |iculties| support|
|00001780| 69 6e 67 20 73 74 61 63 | 6b 20 61 72 63 68 69 74 |ing stac|k archit|
|00001790| 65 63 74 75 72 65 73 2e | 0a 0a 54 68 65 20 56 4d |ectures.|..The VM|
|000017a0| 20 64 6f 65 73 20 6e 6f | 74 20 73 75 70 70 6f 72 | does no|t suppor|
|000017b0| 74 20 63 6f 6e 63 75 72 | 72 65 6e 74 20 6c 69 67 |t concur|rent lig|
|000017c0| 68 74 77 65 69 67 68 74 | 20 70 72 6f 63 65 73 73 |htweight| process|
|000017d0| 65 73 2e 20 20 4c 6f 63 | 6b 69 6e 67 20 70 72 69 |es. Loc|king pri|
|000017e0| 6d 69 74 69 76 65 73 0a | 61 6e 64 20 64 65 65 70 |mitives.|and deep|
|000017f0| 2d 62 69 6e 64 69 6e 67 | 20 6f 66 20 73 70 65 63 |-binding| of spec|
|00001800| 69 61 6c 73 20 77 6f 75 | 6c 64 20 62 65 20 6e 65 |ials wou|ld be ne|
|00001810| 65 64 65 64 2e 0a 0a 54 | 68 65 20 56 4d 20 64 6f |eded...T|he VM do|
|00001820| 65 73 20 6e 6f 74 20 64 | 65 61 6c 20 77 69 74 68 |es not d|eal with|
|00001830| 20 6f 70 65 72 61 74 69 | 6e 67 20 73 79 73 74 65 | operati|ng syste|
|00001840| 6d 73 20 69 6e 74 65 72 | 66 61 63 65 20 69 73 73 |ms inter|face iss|
|00001850| 75 65 73 20 61 74 20 61 | 6c 6c 2e 20 20 41 20 6d |ues at a|ll. A m|
|00001860| 69 6e 69 6d 61 6c 0a 70 | 6f 72 74 20 77 6f 75 6c |inimal.p|ort woul|
|00001870| 64 20 72 65 71 75 69 72 | 65 20 69 6d 70 6c 65 6d |d requir|e implem|
|00001880| 65 6e 74 69 6e 67 20 61 | 74 20 6c 65 61 73 74 20 |enting a|t least |
|00001890| 66 69 6c 65 20 61 6e 64 | 20 74 65 72 6d 69 6e 61 |file and| termina|
|000018a0| 6c 20 49 2f 4f 20 73 74 | 72 65 61 6d 73 2e 20 20 |l I/O st|reams. |
|000018b0| 5c 63 63 6c 0a 69 6d 70 | 6c 65 6d 65 6e 74 73 20 |\ccl.imp|lements |
|000018c0| 73 79 73 74 65 6d 20 69 | 6e 74 65 72 66 61 63 65 |system i|nterface|
|000018d0| 73 20 75 73 69 6e 67 20 | 41 6c 69 65 6e 73 20 61 |s using |Aliens a|
|000018e0| 6e 64 20 6f 74 68 65 72 | 20 66 61 63 69 6c 69 74 |nd other| facilit|
|000018f0| 69 65 73 20 62 75 69 6c | 74 20 6f 6e 20 74 6f 70 |ies buil|t on top|
|00001900| 20 6f 66 0a 74 68 65 6d | 2e 0a 0a 5c 65 6e 64 7b | of.them|...\end{|
|00001910| 63 6f 6d 6d 65 6e 74 7d | 0a 0a 0a 0a 4d 61 6a 6f |comment}|....Majo|
|00001920| 72 20 63 6f 6d 70 6f 6e | 65 6e 74 73 3a 0a 5c 62 |r compon|ents:.\b|
|00001930| 65 67 69 6e 7b 69 74 65 | 6d 69 7a 65 7d 0a 53 70 |egin{ite|mize}.Sp|
|00001940| 65 63 69 66 69 63 20 76 | 69 72 74 75 61 6c 20 6f |ecific v|irtual o|
|00001950| 70 65 72 61 74 69 6f 6e | 73 20 69 6d 70 6c 65 6d |peration|s implem|
|00001960| 65 6e 74 65 64 20 62 79 | 20 74 68 65 20 56 4d 20 |ented by| the VM |
|00001970| 28 56 4f 50 73 29 2e 20 | 20 56 4f 50 73 20 61 72 |(VOPs). | VOPs ar|
|00001980| 65 20 70 72 69 6d 61 72 | 69 6c 79 0a 74 68 65 20 |e primar|ily.the |
|00001990| 63 6f 6e 63 65 72 6e 20 | 6f 66 20 74 68 65 20 63 |concern |of the c|
|000019a0| 6f 6d 70 69 6c 65 72 2c | 20 73 69 6e 63 65 20 69 |ompiler,| since i|
|000019b0| 74 20 74 72 61 6e 73 6c | 61 74 65 73 20 4c 69 73 |t transl|ates Lis|
|000019c0| 70 20 63 6f 64 65 20 69 | 6e 74 6f 20 56 4f 50 73 |p code i|nto VOPs|
|000019d0| 20 61 6e 64 20 74 68 65 | 6e 0a 74 72 61 6e 73 6c | and the|n.transl|
|000019e0| 61 74 65 73 20 56 4f 50 | 73 20 69 6e 74 6f 20 74 |ates VOP|s into t|
|000019f0| 68 65 20 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |he imple|mentatio|
|00001a00| 6e 2e 0a 0a 53 75 62 2d | 70 72 69 6d 69 74 69 76 |n...Sub-|primitiv|
|00001a10| 65 73 20 74 68 61 74 20 | 61 72 65 20 75 73 65 64 |es that |are used|
|00001a20| 20 62 79 20 4c 69 73 70 | 20 63 6f 64 65 20 6e 65 | by Lisp| code ne|
|00001a30| 65 64 69 6e 67 20 74 6f | 20 70 65 72 66 6f 72 6d |eding to| perform|
|00001a40| 20 6f 70 65 72 61 74 69 | 6f 6e 73 0a 62 65 6c 6f | operati|ons.belo|
|00001a50| 77 20 74 68 65 20 4c 69 | 73 70 20 6c 65 76 65 6c |w the Li|sp level|
|00001a60| 2e 20 20 54 68 65 20 63 | 6f 6d 70 69 6c 65 72 20 |. The c|ompiler |
|00001a70| 69 6d 70 6c 65 6d 65 6e | 74 73 20 73 6f 6d 65 20 |implemen|ts some |
|00001a80| 73 75 62 2d 70 72 69 6d | 69 74 69 76 65 73 20 64 |sub-prim|itives d|
|00001a90| 69 72 65 63 74 6c 79 0a | 75 73 69 6e 67 20 56 4f |irectly.|using VO|
|00001aa0| 50 73 2c 20 77 68 69 6c | 65 20 6f 74 68 65 72 73 |Ps, whil|e others|
|00001ab0| 20 61 72 65 20 74 72 61 | 6e 73 6c 61 74 65 64 20 | are tra|nslated |
|00001ac0| 69 6e 74 6f 20 4c 69 73 | 70 20 63 6f 64 65 2e 20 |into Lis|p code. |
|00001ad0| 20 53 75 62 2d 70 72 69 | 6d 69 74 69 76 65 73 20 | Sub-pri|mitives |
|00001ae0| 70 72 6f 76 69 64 65 0a | 61 20 6c 61 79 65 72 20 |provide.|a layer |
|00001af0| 6f 66 20 69 6e 73 75 6c | 61 74 69 6f 6e 20 62 65 |of insul|ation be|
|00001b00| 74 77 65 65 6e 20 74 68 | 65 20 4c 69 73 70 20 73 |tween th|e Lisp s|
|00001b10| 79 73 74 65 6d 20 63 6f | 64 65 20 61 6e 64 20 74 |ystem co|de and t|
|00001b20| 68 65 20 56 4d 2c 20 73 | 69 6e 63 65 20 74 68 65 |he VM, s|ince the|
|00001b30| 20 4c 69 73 70 0a 63 6f | 64 65 20 6d 61 79 20 61 | Lisp.co|de may a|
|00001b40| 73 73 75 6d 65 20 74 68 | 65 20 65 78 69 73 74 65 |ssume th|e existe|
|00001b50| 6e 63 65 20 6f 66 20 6f | 70 65 72 61 74 69 6f 6e |nce of o|peration|
|00001b60| 73 20 74 68 61 74 20 61 | 72 65 20 6e 6f 74 20 69 |s that a|re not i|
|00001b70| 6d 70 6c 65 6d 65 6e 74 | 65 64 20 64 69 72 65 63 |mplement|ed direc|
|00001b80| 74 6c 79 0a 62 79 20 74 | 68 65 20 56 4d 2e 20 20 |tly.by t|he VM. |
|00001b90| 4f 6e 6c 79 20 73 75 62 | 2d 70 72 69 6d 69 74 69 |Only sub|-primiti|
|00001ba0| 76 65 73 20 77 69 74 68 | 20 66 61 69 72 6c 79 20 |ves with| fairly |
|00001bb0| 70 6f 72 74 61 62 6c 65 | 20 73 65 6d 61 6e 74 69 |portable| semanti|
|00001bc0| 63 73 20 61 72 65 20 64 | 6f 63 75 6d 65 6e 74 65 |cs are d|ocumente|
|00001bd0| 64 0a 68 65 72 65 2e 20 | 20 4f 74 68 65 72 73 20 |d.here. | Others |
|00001be0| 61 72 65 20 69 6e 20 69 | 6d 70 6c 65 6d 65 6e 74 |are in i|mplement|
|00001bf0| 61 74 69 6f 6e 2d 73 70 | 65 63 69 66 69 63 20 56 |ation-sp|ecific V|
|00001c00| 4d 20 64 6f 63 75 6d 65 | 6e 74 61 74 69 6f 6e 2e |M docume|ntation.|
|00001c10| 0a 5c 65 6e 64 7b 69 74 | 65 6d 69 7a 65 7d 0a 0a |.\end{it|emize}..|
|00001c20| 5c 63 6f 6d 6d 65 6e 74 | 3c 4e 6f 74 20 61 6c 6c |\comment|<Not all|
|00001c30| 20 73 75 62 2d 70 72 69 | 6d 69 74 69 76 65 73 20 | sub-pri|mitives |
|00001c40| 61 72 65 20 56 4f 50 73 | 2c 20 61 6e 64 20 6d 6f |are VOPs|, and mo|
|00001c50| 73 74 20 56 4f 50 73 20 | 61 72 65 20 6e 6f 74 20 |st VOPs |are not |
|00001c60| 73 75 62 2d 70 72 69 6d | 69 74 69 76 65 73 2e 3e |sub-prim|itives.>|
|00001c70| 0a 0a 0a 0c 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |.....\su|bsection|
|00001c80| 7b 56 4f 50 20 62 61 73 | 65 20 6e 61 6d 65 20 72 |{VOP bas|e name r|
|00001c90| 75 6c 65 73 7d 0a 0a 54 | 68 65 20 6e 61 6d 65 73 |ules}..T|he names|
|00001ca0| 20 6f 66 20 56 4f 50 73 | 20 74 68 61 74 20 69 6d | of VOPs| that im|
|00001cb0| 70 6c 65 6d 65 6e 74 20 | 66 75 6e 63 74 69 6f 6e |plement |function|
|00001cc0| 73 20 61 72 65 20 62 61 | 73 65 64 20 6f 6e 20 74 |s are ba|sed on t|
|00001cd0| 68 65 20 66 75 6e 63 74 | 69 6f 6e 20 6e 61 6d 65 |he funct|ion name|
|00001ce0| 2e 0a 4f 74 68 65 72 20 | 56 4f 50 73 20 6d 61 79 |..Other |VOPs may|
|00001cf0| 20 75 73 65 20 61 6e 79 | 20 62 61 73 65 20 74 68 | use any| base th|
|00001d00| 61 74 20 64 6f 65 73 6e | 27 74 20 63 6f 6e 66 6c |at doesn|'t confl|
|00001d10| 69 63 74 20 77 69 74 68 | 20 61 20 66 75 6e 63 74 |ict with| a funct|
|00001d20| 69 6f 6e 20 6e 61 6d 65 | 2e 20 20 54 68 65 72 65 |ion name|. There|
|00001d30| 0a 61 72 65 20 73 6f 6d | 65 20 72 75 6c 65 73 20 |.are som|e rules |
|00001d40| 75 73 65 64 20 74 6f 20 | 6f 62 74 61 69 6e 20 74 |used to |obtain t|
|00001d50| 68 65 20 62 61 73 65 20 | 6e 61 6d 65 20 66 6f 72 |he base |name for|
|00001d60| 20 72 65 6c 61 74 65 64 | 20 6f 70 65 72 61 74 69 | related| operati|
|00001d70| 6f 6e 73 2e 0a 0a 54 6f | 20 67 65 74 20 74 68 65 |ons...To| get the|
|00001d80| 20 6e 61 6d 65 20 6f 66 | 20 61 20 73 65 74 74 69 | name of| a setti|
|00001d90| 6e 67 20 6f 70 65 72 61 | 74 69 6f 6e 2c 20 72 65 |ng opera|tion, re|
|00001da0| 70 6c 61 63 65 20 74 68 | 65 20 73 74 72 69 6e 67 |place th|e string|
|00001db0| 20 22 7b 5c 74 74 20 72 | 65 66 7d 22 20 69 6e 20 | "{\tt r|ef}" in |
|00001dc0| 74 68 65 20 6e 61 6d 65 | 0a 77 69 74 68 20 22 7b |the name|.with "{|
|00001dd0| 5c 74 74 20 73 65 74 7d | 22 2e 20 20 49 66 20 22 |\tt set}|". If "|
|00001de0| 7b 5c 74 74 20 72 65 66 | 7d 22 20 64 6f 65 73 6e |{\tt ref|}" doesn|
|00001df0| 27 74 20 61 70 70 65 61 | 72 20 69 6e 20 74 68 65 |'t appea|r in the|
|00001e00| 20 6e 61 6d 65 2c 20 61 | 64 64 20 74 68 65 20 70 | name, a|dd the p|
|00001e10| 72 65 66 69 78 20 22 7b | 5c 74 74 20 73 65 74 2d |refix "{|\tt set-|
|00001e20| 7d 22 20 74 6f 20 74 68 | 65 0a 62 61 73 65 20 6e |}" to th|e.base n|
|00001e30| 61 6d 65 2e 20 20 46 6f | 72 20 65 78 61 6d 70 6c |ame. Fo|r exampl|
|00001e40| 65 2c 20 7b 5c 74 74 20 | 73 76 72 65 66 7d 20 62 |e, {\tt |svref} b|
|00001e50| 65 63 6f 6d 65 73 20 7b | 5c 74 74 20 73 76 73 65 |ecomes {|\tt svse|
|00001e60| 74 7d 2c 20 61 6e 64 20 | 7b 5c 74 74 20 73 79 6d |t}, and |{\tt sym|
|00001e70| 62 6f 6c 2d 76 61 6c 75 | 65 7d 0a 62 65 63 6f 6d |bol-valu|e}.becom|
|00001e80| 65 73 20 7b 5c 74 74 20 | 73 65 74 2d 73 79 6d 62 |es {\tt |set-symb|
|00001e90| 6f 6c 2d 76 61 6c 75 65 | 7d 2e 0a 0a 54 6f 20 67 |ol-value|}...To g|
|00001ea0| 65 74 20 74 68 65 20 6e | 61 6d 65 20 6f 66 20 61 |et the n|ame of a|
|00001eb0| 20 63 6f 6e 64 69 74 69 | 6f 6e 61 6c 20 56 4f 50 | conditi|onal VOP|
|00001ec0| 20 66 72 6f 6d 20 74 68 | 65 20 6e 61 6d 65 20 6f | from th|e name o|
|00001ed0| 66 20 61 20 70 72 65 64 | 69 63 61 74 65 2c 20 61 |f a pred|icate, a|
|00001ee0| 64 64 20 74 68 65 0a 70 | 72 65 66 69 78 20 22 7b |dd the.p|refix "{|
|00001ef0| 5c 74 74 20 69 66 2d 7d | 22 20 74 6f 20 74 68 65 |\tt if-}|" to the|
|00001f00| 20 70 72 65 64 69 63 61 | 74 65 20 6e 61 6d 65 2e | predica|te name.|
|00001f10| 20 20 46 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 7b | For ex|ample, {|
|00001f20| 5c 74 74 20 65 71 7d 20 | 62 65 63 6f 6d 65 73 20 |\tt eq} |becomes |
|00001f30| 7b 5c 74 74 20 69 66 2d | 65 71 7d 2e 0a 7b 5c 74 |{\tt if-|eq}..{\t|
|00001f40| 74 20 65 71 7d 20 62 79 | 20 69 74 73 65 6c 66 20 |t eq} by| itself |
|00001f50| 77 6f 75 6c 64 20 62 65 | 20 61 20 56 4f 50 20 74 |would be| a VOP t|
|00001f60| 68 61 74 20 72 65 74 75 | 72 6e 65 64 20 74 72 75 |hat retu|rned tru|
|00001f70| 65 20 6f 72 20 66 61 6c | 73 65 20 76 61 6c 75 65 |e or fal|se value|
|00001f80| 2e 0a 0a 53 6f 6d 65 20 | 6f 70 65 72 61 74 69 6f |...Some |operatio|
|00001f90| 6e 73 20 63 68 65 63 6b | 20 66 6f 72 20 73 6f 6d |ns check| for som|
|00001fa0| 65 20 65 72 72 6f 72 20 | 63 6f 6e 64 69 74 69 6f |e error |conditio|
|00001fb0| 6e 2c 20 6d 61 67 69 63 | 61 6c 6c 79 20 73 69 67 |n, magic|ally sig|
|00001fc0| 6e 61 6c 6c 69 6e 67 20 | 74 68 65 20 65 72 72 6f |nalling |the erro|
|00001fd0| 72 0a 74 68 72 6f 75 67 | 68 20 61 6e 20 69 6d 70 |r.throug|h an imp|
|00001fe0| 6c 69 63 69 74 20 63 6f | 6e 74 72 6f 6c 20 74 72 |licit co|ntrol tr|
|00001ff0| 61 6e 73 66 65 72 2e 20 | 20 54 68 65 73 65 20 6f |ansfer. | These o|
|00002000| 70 65 72 61 74 69 6f 6e | 73 20 61 72 65 20 70 72 |peration|s are pr|
|00002010| 65 66 69 78 65 64 20 77 | 69 74 68 0a 22 7b 5c 74 |efixed w|ith."{\t|
|00002020| 74 20 63 68 65 63 6b 2d | 7d 22 2c 20 61 73 20 69 |t check-|}", as i|
|00002030| 6e 20 7b 5c 74 74 20 63 | 68 65 63 6b 2d 66 69 78 |n {\tt c|heck-fix|
|00002040| 6e 75 6d 7d 20 61 6e 64 | 20 7b 5c 74 74 20 63 68 |num} and| {\tt ch|
|00002050| 65 63 6b 2d 62 6f 75 6e | 64 7d 2e 0a 0a 0a 0c 0a |eck-boun|d}......|
|00002060| 5c 73 75 62 73 65 63 74 | 69 6f 6e 7b 56 4f 50 20 |\subsect|ion{VOP |
|00002070| 6e 61 6d 65 20 70 72 65 | 66 69 78 65 73 20 61 6e |name pre|fixes an|
|00002080| 64 20 73 75 66 66 69 78 | 65 73 7d 0a 0a 50 72 65 |d suffix|es}..Pre|
|00002090| 66 69 78 65 73 20 61 6e | 64 20 73 75 66 66 69 78 |fixes an|d suffix|
|000020a0| 65 73 20 61 72 65 20 61 | 64 64 65 64 20 74 6f 20 |es are a|dded to |
|000020b0| 74 68 65 20 62 61 73 65 | 20 74 6f 20 67 65 74 20 |the base| to get |
|000020c0| 74 68 65 20 6e 61 6d 65 | 73 20 6f 66 20 76 61 72 |the name|s of var|
|000020d0| 69 61 6e 74 0a 76 65 72 | 73 69 6f 6e 73 20 6f 66 |iant.ver|sions of|
|000020e0| 20 74 68 65 20 56 4f 50 | 2e 20 20 54 68 65 20 66 | the VOP|. The f|
|000020f0| 75 6c 6c 79 20 67 65 6e | 65 72 61 6c 20 56 4f 50 |ully gen|eral VOP|
|00002100| 20 6e 61 6d 65 20 6c 6f | 6f 6b 73 20 6c 69 6b 65 | name lo|oks like|
|00002110| 20 74 68 69 73 3a 0a 5c | 62 65 67 69 6e 7b 66 6f | this:.\|begin{fo|
|00002120| 72 6d 61 74 7d 0a 20 20 | 20 7b 22 7b 5c 74 74 20 |rmat}. | {"{\tt |
|00002130| 73 6d 61 6c 6c 2d 7d 22 | 20 7c 20 22 7b 5c 74 74 |small-}"| | "{\tt|
|00002140| 20 66 61 73 74 2d 7d 22 | 7d 20 7b 5c 69 74 20 6e | fast-}"|} {\it n|
|00002150| 61 6d 65 7d 7b 22 7b 5c | 74 74 20 2d 63 7d 22 20 |ame}{"{\|tt -c}" |
|00002160| 7b 5c 69 74 20 69 6e 66 | 6f 7d 7d 7b 22 7b 5c 74 |{\it inf|o}}{"{\t|
|00002170| 74 20 2f 7d 22 20 7b 5c | 69 74 20 74 79 70 65 7d |t /}" {\|it type}|
|00002180| 7b 22 7b 5c 74 74 20 3d | 3e 7d 22 20 7b 5c 69 74 |{"{\tt =|>}" {\it|
|00002190| 20 72 65 73 75 6c 74 2d | 74 79 70 65 7d 7d 0a 5c | result-|type}}.\|
|000021a0| 65 6e 64 7b 66 6f 72 6d | 61 74 7d 0a 54 68 65 20 |end{form|at}.The |
|000021b0| 22 7b 5c 74 74 20 73 6d | 61 6c 6c 2d 7d 22 20 61 |"{\tt sm|all-}" a|
|000021c0| 6e 64 20 22 7b 5c 74 74 | 20 66 61 73 74 2d 7d 22 |nd "{\tt| fast-}"|
|000021d0| 20 70 72 65 66 69 78 65 | 73 20 69 6e 64 69 63 61 | prefixe|s indica|
|000021e0| 74 65 73 20 74 68 61 74 | 20 74 68 65 20 56 4f 50 |tes that| the VOP|
|000021f0| 20 64 6f 65 73 20 6d 69 | 6e 69 6d 61 6c 0a 73 61 | does mi|nimal.sa|
|00002200| 66 65 74 79 20 63 68 65 | 63 6b 69 6e 67 20 61 6e |fety che|cking an|
|00002210| 64 20 69 73 20 6f 70 74 | 69 6d 69 7a 65 64 20 66 |d is opt|imized f|
|00002220| 6f 72 20 73 70 61 63 65 | 20 6f 72 20 73 70 65 65 |or space| or spee|
|00002230| 64 2c 20 72 65 73 70 65 | 63 74 69 76 65 6c 79 2e |d, respe|ctively.|
|00002240| 20 20 54 68 65 20 61 62 | 73 65 6e 63 65 0a 6f 66 | The ab|sence.of|
|00002250| 20 61 20 70 72 65 66 69 | 78 20 69 6e 64 69 63 61 | a prefi|x indica|
|00002260| 74 65 73 20 74 68 65 20 | 73 61 66 65 73 74 20 28 |tes the |safest (|
|00002270| 6f 72 20 6f 6e 6c 79 29 | 20 76 65 72 73 69 6f 6e |or only)| version|
|00002280| 2e 20 20 55 73 75 61 6c | 6c 79 20 69 66 20 74 68 |. Usual|ly if th|
|00002290| 65 20 22 7b 5c 74 74 20 | 73 6d 61 6c 6c 2d 7d 22 |e "{\tt |small-}"|
|000022a0| 0a 56 4f 50 20 65 78 69 | 73 74 73 2c 20 69 74 20 |.VOP exi|sts, it |
|000022b0| 77 69 6c 6c 20 62 65 20 | 61 20 73 79 6e 6f 6e 79 |will be |a synony|
|000022c0| 6d 20 66 6f 72 20 65 69 | 74 68 65 72 20 74 68 65 |m for ei|ther the|
|000022d0| 20 66 61 73 74 20 76 65 | 72 73 69 6f 6e 20 6f 72 | fast ve|rsion or|
|000022e0| 20 74 68 65 20 73 61 66 | 65 0a 76 65 72 73 69 6f | the saf|e.versio|
|000022f0| 6e 2c 20 64 65 70 65 6e | 64 69 6e 67 20 6f 6e 20 |n, depen|ding on |
|00002300| 77 68 69 63 68 20 69 73 | 20 73 6d 61 6c 6c 65 72 |which is| smaller|
|00002310| 2e 0a 0a 54 68 65 20 22 | 7b 5c 74 74 20 2d 63 7d |...The "|{\tt -c}|
|00002320| 22 20 73 75 66 66 69 78 | 20 69 6e 64 69 63 61 74 |" suffix| indicat|
|00002330| 65 73 20 74 68 61 74 20 | 74 68 65 20 73 6f 6d 65 |es that |the some|
|00002340| 20 69 6e 66 6f 20 74 68 | 61 74 20 69 73 20 70 61 | info th|at is pa|
|00002350| 73 73 65 64 20 61 73 20 | 61 20 6e 6f 72 6d 61 6c |ssed as |a normal|
|00002360| 0a 61 72 67 75 6d 65 6e | 74 20 74 6f 20 74 68 65 |.argumen|t to the|
|00002370| 20 62 61 73 65 20 76 65 | 72 73 69 6f 6e 20 6f 66 | base ve|rsion of|
|00002380| 20 74 68 65 20 56 4f 50 | 20 69 73 20 70 61 73 73 | the VOP| is pass|
|00002390| 65 64 20 61 73 20 43 6f | 64 65 67 65 6e 2d 49 6e |ed as Co|degen-In|
|000023a0| 66 6f 20 69 6e 20 74 68 | 69 73 0a 76 65 72 73 69 |fo in th|is.versi|
|000023b0| 6f 6e 2e 20 20 41 20 74 | 79 70 69 63 61 6c 20 75 |on. A t|ypical u|
|000023c0| 73 65 20 77 6f 75 6c 64 | 20 62 65 20 66 6f 72 20 |se would| be for |
|000023d0| 56 4f 50 73 20 77 68 65 | 72 65 20 69 74 20 69 73 |VOPs whe|re it is|
|000023e0| 20 69 6d 70 6f 72 74 61 | 6e 74 20 74 6f 20 75 73 | importa|nt to us|
|000023f0| 65 20 61 0a 64 69 66 66 | 65 72 65 6e 74 20 76 65 |e a.diff|erent ve|
|00002400| 72 73 69 6f 6e 20 77 68 | 65 6e 20 6f 6e 65 20 6f |rsion wh|en one o|
|00002410| 66 20 74 68 65 20 61 72 | 67 75 6d 65 6e 74 73 20 |f the ar|guments |
|00002420| 69 73 20 61 20 63 6f 6d | 70 69 6c 65 20 74 69 6d |is a com|pile tim|
|00002430| 65 20 63 6f 6e 73 74 61 | 6e 74 2e 0a 7b 5c 69 74 |e consta|nt..{\it|
|00002440| 20 69 6e 66 6f 7d 20 69 | 73 20 73 6f 6d 65 20 28 | info} i|s some (|
|00002450| 70 6f 73 73 69 62 6c 79 | 20 6e 75 6c 6c 29 20 73 |possibly| null) s|
|00002460| 74 72 69 6e 67 20 74 68 | 61 74 20 69 6e 64 69 63 |tring th|at indic|
|00002470| 61 74 65 73 20 77 68 69 | 63 68 20 22 7b 5c 74 74 |ates whi|ch "{\tt|
|00002480| 20 2d 63 7d 22 20 76 61 | 72 69 61 6e 74 0a 69 73 | -c}" va|riant.is|
|00002490| 20 69 6e 76 6f 6c 76 65 | 64 2e 0a 0a 54 68 65 20 | involve|d...The |
|000024a0| 22 7b 5c 74 74 20 2f 7d | 7b 5c 69 74 20 74 79 70 |"{\tt /}|{\it typ|
|000024b0| 65 7d 22 20 73 75 66 66 | 69 78 20 61 73 73 65 72 |e}" suff|ix asser|
|000024c0| 74 73 20 74 68 61 74 20 | 61 6c 6c 20 6f 70 65 72 |ts that |all oper|
|000024d0| 61 6e 64 73 20 74 68 61 | 74 20 63 6f 75 6c 64 20 |ands tha|t could |
|000024e0| 62 65 20 6f 66 20 7b 5c | 69 74 20 74 79 70 65 7d |be of {\|it type}|
|000024f0| 20 61 72 65 2e 0a 46 6f | 72 20 65 78 61 6d 70 6c | are..Fo|r exampl|
|00002500| 65 2c 20 7b 5c 74 74 20 | 2b 2f 66 69 78 6e 75 6d |e, {\tt |+/fixnum|
|00002510| 7d 20 61 64 64 73 20 74 | 77 6f 20 66 69 78 6e 75 |} adds t|wo fixnu|
|00002520| 6d 73 20 72 65 74 75 72 | 6e 69 6e 67 20 61 20 66 |ms retur|ning a f|
|00002530| 69 78 6e 75 6d 2c 20 77 | 68 69 6c 65 0a 7b 5c 74 |ixnum, w|hile.{\t|
|00002540| 74 20 6c 65 6e 67 74 68 | 2f 73 69 6d 70 6c 65 2d |t length|/simple-|
|00002550| 76 65 63 74 6f 72 7d 20 | 66 69 6e 64 73 20 74 68 |vector} |finds th|
|00002560| 65 20 6c 65 6e 67 74 68 | 20 6f 66 20 61 20 73 69 |e length| of a si|
|00002570| 6d 70 6c 65 20 76 65 63 | 74 6f 72 2c 20 62 75 74 |mple vec|tor, but|
|00002580| 20 74 68 65 20 72 65 73 | 75 6c 74 20 69 73 6e 27 | the res|ult isn'|
|00002590| 74 0a 61 20 73 69 6d 70 | 6c 65 20 76 65 63 74 6f |t.a simp|le vecto|
|000025a0| 72 2e 0a 0a 54 68 65 20 | 22 7b 5c 74 74 20 3d 3e |r...The |"{\tt =>|
|000025b0| 7d 7b 5c 69 74 20 72 65 | 73 75 6c 74 2d 74 79 70 |}{\it re|sult-typ|
|000025c0| 65 7d 22 20 73 75 66 66 | 69 78 20 73 75 70 70 6c |e}" suff|ix suppl|
|000025d0| 69 65 73 20 61 20 72 65 | 73 75 6c 74 20 74 79 70 |ies a re|sult typ|
|000025e0| 65 20 61 73 73 65 72 74 | 69 6f 6e 20 6f 6e 20 74 |e assert|ion on t|
|000025f0| 68 65 0a 6f 70 65 72 61 | 74 69 6f 6e 2e 0a 0a 41 |he.opera|tion...A|
|00002600| 20 6e 6f 74 20 74 6f 74 | 61 6c 6c 79 20 73 69 6c | not tot|ally sil|
|00002610| 6c 79 20 65 78 61 6d 70 | 6c 65 20 6f 66 20 61 6c |ly examp|le of al|
|00002620| 6c 20 74 68 65 73 65 20 | 6d 6f 64 69 66 69 65 72 |l these |modifier|
|00002630| 73 20 73 69 6d 75 6c 74 | 61 6e 65 6f 75 73 6c 79 |s simult|aneously|
|00002640| 20 69 73 0a 20 7b 5c 74 | 74 20 66 61 73 74 2d 2b | is. {\t|t fast-+|
|00002650| 2d 63 2f 66 69 78 6e 75 | 6d 3d 3e 69 6e 74 65 67 |-c/fixnu|m=>integ|
|00002660| 65 72 7d 2e 20 20 54 68 | 69 73 20 6f 70 65 72 61 |er}. Th|is opera|
|00002670| 74 69 6f 6e 20 77 6f 75 | 6c 64 20 74 68 69 73 20 |tion wou|ld this |
|00002680| 6f 70 65 72 61 74 69 6f | 6e 20 61 64 64 73 20 74 |operatio|n adds t|
|00002690| 77 6f 0a 66 69 78 6e 75 | 6d 73 2c 20 6f 6e 65 20 |wo.fixnu|ms, one |
|000026a0| 6f 66 20 77 68 69 63 68 | 20 69 73 20 61 20 63 6f |of which| is a co|
|000026b0| 6e 73 74 61 6e 74 20 70 | 61 73 73 65 64 20 61 73 |nstant p|assed as|
|000026c0| 20 63 6f 64 65 67 65 6e | 20 69 6e 66 6f 2c 20 72 | codegen| info, r|
|000026d0| 65 73 75 6c 74 69 6e 67 | 20 69 6e 20 61 6e 0a 69 |esulting| in an.i|
|000026e0| 6e 74 65 67 65 72 2e 20 | 20 54 68 65 20 69 6d 70 |nteger. | The imp|
|000026f0| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 20 69 73 20 6f |lementat|ion is o|
|00002700| 70 74 69 6d 69 7a 65 64 | 20 66 6f 72 20 73 70 65 |ptimized| for spe|
|00002710| 65 64 20 61 74 20 74 68 | 65 20 65 78 70 65 6e 73 |ed at th|e expens|
|00002720| 65 20 6f 66 20 73 70 61 | 63 65 20 61 6e 64 0a 73 |e of spa|ce and.s|
|00002730| 61 66 65 74 79 2e 0a 0a | 0a 0c 0a 5c 63 68 61 70 |afety...|...\chap|
|00002740| 74 65 72 7b 44 61 74 61 | 20 54 79 70 65 73 20 61 |ter{Data| Types a|
|00002750| 6e 64 20 53 74 6f 72 61 | 67 65 20 52 65 73 6f 75 |nd Stora|ge Resou|
|00002760| 72 63 65 73 7d 0a 0a 0c | 0a 5c 73 65 63 74 69 6f |rces}...|.\sectio|
|00002770| 6e 7b 4c 69 73 70 20 4f | 62 6a 65 63 74 73 7d 0a |n{Lisp O|bjects}.|
|00002780| 5c 69 6e 64 65 78 7b 4c | 69 73 70 20 6f 62 6a 65 |\index{L|isp obje|
|00002790| 63 74 73 7d 0a 0a 41 20 | 4c 69 73 70 20 6f 62 6a |cts}..A |Lisp obj|
|000027a0| 65 63 74 20 69 73 20 66 | 69 78 65 64 2d 73 69 7a |ect is f|ixed-siz|
|000027b0| 65 20 64 61 74 61 20 73 | 74 72 75 63 74 75 72 65 |e data s|tructure|
|000027c0| 20 74 68 61 74 20 69 73 | 20 6f 72 67 61 6e 69 7a | that is| organiz|
|000027d0| 65 64 20 69 6e 20 61 20 | 77 61 79 20 6d 61 6e 64 |ed in a |way mand|
|000027e0| 61 74 65 64 0a 62 79 20 | 74 68 65 20 56 4d 20 69 |ated.by |the VM i|
|000027f0| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 2e 20 20 |mplement|ation. |
|00002800| 54 68 65 20 66 69 78 65 | 64 20 66 6f 72 6d 61 74 |The fixe|d format|
|00002810| 20 61 6c 6c 6f 77 73 20 | 74 68 65 20 56 4d 20 74 | allows |the VM t|
|00002820| 6f 20 64 65 74 65 72 6d | 69 6e 65 20 74 68 65 20 |o determ|ine the |
|00002830| 74 79 70 65 0a 6f 66 20 | 74 68 65 20 6f 62 6a 65 |type.of |the obje|
|00002840| 63 74 2e 20 20 5c 63 6f | 6d 6d 65 6e 74 3c 56 69 |ct. \co|mment<Vi|
|00002850| 72 74 75 61 6c 20 74 79 | 70 65 3f 20 20 56 4d 20 |rtual ty|pe? VM |
|00002860| 74 79 70 65 3f 20 20 49 | 6d 70 6c 65 6d 65 6e 74 |type? I|mplement|
|00002870| 61 74 69 6f 6e 20 74 79 | 70 65 3f 0a 2e 2e 2e 70 |ation ty|pe?....p|
|00002880| 72 6f 76 69 64 65 73 20 | 74 68 65 20 56 4d 20 65 |rovides |the VM e|
|00002890| 6e 6f 75 67 68 20 69 6e | 66 6f 72 6d 61 74 69 6f |nough in|formatio|
|000028a0| 6e 20 61 62 6f 75 74 20 | 74 68 65 20 74 79 70 65 |n about |the type|
|000028b0| 20 6f 66 20 74 68 65 20 | 6f 62 6a 65 63 74 20 66 | of the |object f|
|000028c0| 6f 72 20 74 68 65 20 56 | 4d 0a 74 6f 20 69 6d 70 |or the V|M.to imp|
|000028d0| 6c 65 6d 65 6e 74 20 74 | 68 65 20 56 4d 2d 6c 65 |lement t|he VM-le|
|000028e0| 76 65 6c 20 73 65 6d 61 | 6e 74 69 63 73 2e 2e 2e |vel sema|ntics...|
|000028f0| 20 20 2e 2e 2e 73 75 70 | 70 6f 72 74 73 20 74 68 | ...sup|ports th|
|00002900| 65 20 22 64 79 6e 61 6d | 69 63 20 74 79 70 65 73 |e "dynam|ic types|
|00002910| 22 2e 2e 2e 3e 0a 0a 4c | 69 73 70 20 6f 62 6a 65 |"...>..L|isp obje|
|00002920| 63 74 73 20 61 72 65 20 | 73 74 6f 72 65 64 20 69 |cts are |stored i|
|00002930| 6e 20 6c 6f 63 61 74 69 | 6f 6e 73 20 6b 6e 6f 77 |n locati|ons know|
|00002940| 6e 20 61 73 20 63 65 6c | 6c 73 2e 20 0a 0a 0a 48 |n as cel|ls. ...H|
|00002950| 61 73 20 6d 61 6a 6f 72 | 20 74 79 70 65 73 3a 20 |as major| types: |
|00002960| 69 6d 6d 65 64 69 61 74 | 65 20 61 6e 64 20 6e 6f |immediat|e and no|
|00002970| 6e 2d 69 6d 6d 65 64 69 | 61 74 65 2e 0a 4e 6f 6e |n-immedi|ate..Non|
|00002980| 2d 69 6d 6d 65 64 69 61 | 74 65 20 6f 62 6a 65 63 |-immedia|te objec|
|00002990| 74 73 20 6d 61 79 20 68 | 61 76 65 20 61 20 73 75 |ts may h|ave a su|
|000029a0| 62 74 79 70 65 2e 0a 4e | 6f 6e 2d 69 6d 6d 65 64 |btype..N|on-immed|
|000029b0| 69 61 74 65 20 74 79 70 | 65 73 3a 0a 20 20 73 79 |iate typ|es:. sy|
|000029c0| 6d 62 6f 6c 20 28 6e 69 | 6c 20 6d 61 79 20 62 65 |mbol (ni|l may be|
|000029d0| 20 77 65 69 72 64 29 0a | 20 20 63 6f 6e 73 20 0a | weird).| cons .|
|000029e0| 20 20 72 61 74 69 6f 0a | 20 20 63 6f 6d 70 6c 65 | ratio.| comple|
|000029f0| 78 0a 20 20 73 6f 6d 65 | 20 66 6c 6f 61 74 20 74 |x. some| float t|
|00002a00| 79 70 65 73 0a 20 20 67 | 2d 76 65 63 74 6f 72 0a |ypes. g|-vector.|
|00002a10| 20 20 69 2d 76 65 63 74 | 6f 72 0a 20 20 73 74 72 | i-vect|or. str|
|00002a20| 69 6e 67 0a 20 20 62 69 | 74 2d 76 65 63 74 6f 72 |ing. bi|t-vector|
|00002a30| 0a 20 20 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 20 28 |. envir|onment (|
|00002a40| 61 6c 77 61 79 73 20 68 | 61 73 20 73 75 62 74 79 |always h|as subty|
|00002a50| 70 65 29 0a 20 20 61 72 | 72 61 79 20 68 65 61 64 |pe). ar|ray head|
|00002a60| 65 72 0a 20 20 62 69 67 | 6e 75 6d 0a 20 20 73 74 |er. big|num. st|
|00002a70| 72 75 63 74 75 72 65 0a | 20 20 70 63 20 28 63 6f |ructure.| pc (co|
|00002a80| 64 65 20 76 65 63 74 6f | 72 29 0a 20 20 73 74 61 |de vecto|r). sta|
|00002a90| 63 6b 20 63 6c 6f 73 75 | 72 65 20 28 63 6f 6e 74 |ck closu|re (cont|
|00002aa0| 72 6f 6c 20 73 74 61 63 | 6b 20 70 6f 69 6e 74 65 |rol stac|k pointe|
|00002ab0| 72 29 0a 0a 4e 6f 6e 2d | 69 6d 6d 65 64 69 61 74 |r)..Non-|immediat|
|00002ac0| 65 20 6f 62 6a 65 63 74 | 73 20 61 72 65 20 61 6c |e object|s are al|
|00002ad0| 6c 6f 63 61 74 65 64 20 | 69 6e 20 22 74 79 70 65 |located |in "type|
|00002ae0| 20 73 70 61 63 65 73 22 | 2e 20 20 54 68 65 20 74 | spaces"|. The t|
|00002af0| 79 70 65 20 73 70 61 63 | 65 20 6f 66 20 61 6e 0a |ype spac|e of an.|
|00002b00| 6f 62 6a 65 63 74 20 69 | 73 20 63 68 61 72 61 63 |object i|s charac|
|00002b10| 74 65 72 69 7a 65 64 20 | 62 79 20 61 20 73 6d 61 |terized |by a sma|
|00002b20| 6c 6c 20 69 6e 74 65 67 | 65 72 20 6b 6e 6f 77 6e |ll integ|er known|
|00002b30| 20 61 73 20 74 68 65 20 | 74 79 70 65 20 63 6f 64 | as the |type cod|
|00002b40| 65 2e 20 20 41 6e 79 20 | 74 77 6f 0a 6f 62 6a 65 |e. Any |two.obje|
|00002b50| 63 74 73 20 6f 66 20 6f | 6e 65 20 6f 66 20 74 68 |cts of o|ne of th|
|00002b60| 65 20 61 62 6f 76 65 20 | 62 6f 78 65 64 20 74 79 |e above |boxed ty|
|00002b70| 70 65 73 20 77 69 6c 6c | 20 61 6c 77 61 79 73 20 |pes will| always |
|00002b80| 68 61 76 65 20 74 68 65 | 20 73 61 6d 65 20 74 79 |have the| same ty|
|00002b90| 70 65 20 63 6f 64 65 2e | 0a 7b 42 75 74 20 6e 6f |pe code.|.{But no|
|00002ba0| 74 20 72 65 61 6c 6c 79 | 2e 2e 2e 20 20 53 6f 6d |t really|... Som|
|00002bb0| 65 20 74 79 70 65 73 20 | 6d 69 67 68 74 20 62 65 |e types |might be|
|00002bc0| 20 61 6c 6c 6f 63 61 74 | 65 64 20 69 6e 20 64 69 | allocat|ed in di|
|00002bd0| 66 66 65 72 65 6e 74 20 | 74 79 70 65 20 73 70 61 |fferent |type spa|
|00002be0| 63 65 73 20 61 74 0a 64 | 69 66 66 65 72 65 6e 74 |ces at.d|ifferent|
|00002bf0| 20 74 69 6d 65 73 2e 20 | 28 3f 29 7d 0a 0a 54 68 | times. |(?)}..Th|
|00002c00| 65 20 74 79 70 65 20 63 | 6f 64 65 20 64 6f 65 73 |e type c|ode does|
|00002c10| 6e 27 74 20 74 6f 74 61 | 6c 6c 79 20 64 65 73 63 |n't tota|lly desc|
|00002c20| 72 69 62 65 20 74 68 65 | 20 6f 62 6a 65 63 74 2e |ribe the| object.|
|00002c30| 20 20 49 6e 20 67 65 6e | 65 72 61 6c 2c 20 73 75 | In gen|eral, su|
|00002c40| 62 74 79 70 65 0a 69 6e | 66 6f 72 6d 61 74 69 6f |btype.in|formatio|
|00002c50| 6e 20 6d 61 79 20 62 65 | 20 69 6e 76 6f 6c 76 65 |n may be| involve|
|00002c60| 64 2e 0a 0a 0a 49 6d 6d | 65 64 69 61 74 65 20 74 |d....Imm|ediate t|
|00002c70| 79 70 65 73 3a 0a 20 20 | 63 68 61 72 61 63 74 65 |ypes:. |characte|
|00002c80| 72 0a 20 20 66 69 78 6e | 75 6d 0a 20 20 75 6e 62 |r. fixn|um. unb|
|00002c90| 6f 75 6e 64 20 74 72 61 | 70 0a 20 20 73 68 6f 72 |ound tra|p. shor|
|00002ca0| 74 20 66 6c 6f 61 74 0a | 0a 0a 0c 0a 5c 73 65 63 |t float.|....\sec|
|00002cb0| 74 69 6f 6e 7b 54 79 70 | 65 20 56 4f 50 73 7d 0a |tion{Typ|e VOPs}.|
|00002cc0| 0a 57 65 20 63 6f 6e 73 | 69 64 65 72 20 63 6f 6e |.We cons|ider con|
|00002cd0| 74 72 6f 6c 20 74 72 61 | 6e 73 66 65 72 20 74 6f |trol tra|nsfer to|
|00002ce0| 20 62 65 20 74 68 65 20 | 66 75 6e 64 61 6d 65 6e | be the |fundamen|
|00002cf0| 74 61 6c 20 72 65 73 75 | 6c 74 20 6f 66 20 63 6f |tal resu|lt of co|
|00002d00| 6d 70 61 72 69 73 6f 6e | 2c 20 72 61 74 68 65 72 |mparison|, rather|
|00002d10| 0a 74 68 61 6e 20 61 6e | 79 74 68 69 6e 67 20 73 |.than an|ything s|
|00002d20| 75 63 68 20 61 73 20 61 | 20 63 6f 6e 64 69 74 69 |uch as a| conditi|
|00002d30| 6f 6e 20 63 6f 64 65 2e | 20 20 41 6c 74 68 6f 75 |on code.| Althou|
|00002d40| 67 68 20 6d 6f 73 74 20 | 63 6f 6d 70 69 6c 65 72 |gh most |compiler|
|00002d50| 73 20 77 69 74 68 20 77 | 68 69 7a 7a 79 0a 72 65 |s with w|hizzy.re|
|00002d60| 67 69 73 74 65 72 20 61 | 6c 6c 6f 63 61 74 69 6f |gister a|llocatio|
|00002d70| 6e 20 73 65 65 6d 20 74 | 6f 20 65 78 70 6c 69 63 |n seem t|o explic|
|00002d80| 69 74 6c 79 20 61 6c 6c | 6f 63 61 74 65 20 61 6e |itly all|ocate an|
|00002d90| 64 20 6d 61 6e 69 70 75 | 6c 61 74 65 20 74 68 65 |d manipu|late the|
|00002da0| 20 63 6f 6e 64 69 74 69 | 6f 6e 0a 63 6f 64 65 73 | conditi|on.codes|
|00002db0| 2c 20 69 74 20 73 65 65 | 6d 73 20 74 68 61 74 20 |, it see|ms that |
|00002dc0| 61 6e 79 20 62 65 6e 65 | 66 69 74 20 69 73 20 73 |any bene|fit is s|
|00002dd0| 6d 61 6c 6c 20 69 6e 20 | 6f 75 72 20 63 61 73 65 |mall in |our case|
|00002de0| 2e 20 20 54 68 69 73 20 | 69 73 20 70 61 72 74 6c |. This |is partl|
|00002df0| 79 20 62 65 63 61 75 73 | 65 0a 6f 75 72 20 56 4f |y becaus|e.our VO|
|00002e00| 50 73 20 61 72 65 20 61 | 74 20 61 20 73 6f 6d 65 |Ps are a|t a some|
|00002e10| 77 68 61 74 20 68 69 67 | 68 65 72 20 6c 65 76 65 |what hig|her leve|
|00002e20| 6c 2c 20 6d 61 6b 69 6e | 67 20 69 74 20 64 69 66 |l, makin|g it dif|
|00002e30| 66 69 63 75 6c 74 20 74 | 6f 20 74 65 6c 6c 20 77 |ficult t|o tell w|
|00002e40| 68 69 63 68 20 56 4f 50 | 73 0a 64 6f 20 61 6e 64 |hich VOP|s.do and|
|00002e50| 20 64 6f 6e 27 74 20 74 | 72 61 73 68 20 74 68 65 | don't t|rash the|
|00002e60| 20 74 68 65 20 43 43 2e | 20 20 45 78 70 6c 69 63 | the CC.| Explic|
|00002e70| 69 74 6c 79 20 69 6e 63 | 6f 72 70 6f 72 61 74 69 |itly inc|orporati|
|00002e80| 6e 67 20 63 6f 6e 64 69 | 74 69 6f 6e 20 63 6f 64 |ng condi|tion cod|
|00002e90| 65 73 20 69 6e 20 6f 75 | 72 0a 56 4d 20 61 6c 73 |es in ou|r.VM als|
|00002ea0| 6f 20 69 6e 74 72 6f 64 | 75 63 65 73 20 61 6e 6f |o introd|uces ano|
|00002eb0| 74 68 65 72 20 61 72 63 | 68 69 74 65 63 74 75 72 |ther arc|hitectur|
|00002ec0| 65 20 64 65 70 65 6e 64 | 65 6e 63 79 2e 0a 0a 41 |e depend|ency...A|
|00002ed0| 74 20 74 68 65 20 49 52 | 32 20 6c 65 76 65 6c 2c |t the IR|2 level,|
|00002ee0| 20 77 65 20 68 61 76 65 | 20 61 20 63 6c 61 73 73 | we have| a class|
|00002ef0| 20 6f 66 20 49 46 2d 58 | 58 58 20 56 4f 50 73 20 | of IF-X|XX VOPs |
|00002f00| 77 68 69 63 68 20 74 72 | 61 6e 73 66 65 72 20 63 |which tr|ansfer c|
|00002f10| 6f 6e 74 72 6f 6c 20 74 | 6f 20 6f 6e 65 0a 6f 66 |ontrol t|o one.of|
|00002f20| 20 74 77 6f 20 70 6c 61 | 63 65 73 20 6f 6e 20 74 | two pla|ces on t|
|00002f30| 68 65 20 62 61 73 69 73 | 20 6f 66 20 73 6f 6d 65 |he basis| of some|
|00002f40| 20 74 65 73 74 20 6f 6e | 20 74 68 65 20 6f 70 65 | test on| the ope|
|00002f50| 72 61 6e 64 73 2e 20 20 | 57 68 65 6e 20 67 65 6e |rands. |When gen|
|00002f60| 65 72 61 74 69 6e 67 20 | 63 6f 64 65 0a 66 6f 72 |erating |code.for|
|00002f70| 20 61 20 70 72 65 64 69 | 63 61 74 65 2c 20 77 65 | a predi|cate, we|
|00002f80| 20 70 65 65 6b 20 61 74 | 20 74 68 65 20 64 65 73 | peek at| the des|
|00002f90| 74 69 6e 61 74 69 6f 6e | 20 49 46 20 6e 6f 64 65 |tination| IF node|
|00002fa0| 20 74 6f 20 66 69 6e 64 | 20 77 68 65 72 65 20 74 | to find| where t|
|00002fb0| 6f 20 74 72 61 6e 73 66 | 65 72 0a 63 6f 6e 74 72 |o transf|er.contr|
|00002fc0| 6f 6c 20 74 6f 2e 0a 09 | 09 09 0a 54 68 65 20 65 |ol to...|...The e|
|00002fd0| 78 61 63 74 20 72 65 70 | 72 65 73 65 6e 74 61 74 |xact rep|resentat|
|00002fe0| 69 6f 6e 20 6f 66 20 74 | 79 70 65 20 74 65 73 74 |ion of t|ype test|
|00002ff0| 73 20 69 6e 20 49 52 32 | 20 77 69 6c 6c 20 62 65 |s in IR2| will be|
|00003000| 20 66 61 69 72 6c 79 20 | 69 6d 70 6c 65 6d 65 6e | fairly |implemen|
|00003010| 74 61 74 69 6f 6e 0a 64 | 65 70 65 6e 64 65 6e 74 |tation.d|ependent|
|00003020| 2c 20 73 69 6e 63 65 20 | 69 74 20 77 69 6c 6c 20 |, since |it will |
|00003030| 64 65 70 65 6e 64 20 6f | 6e 20 74 68 65 20 73 70 |depend o|n the sp|
|00003040| 65 63 69 66 69 63 20 74 | 79 70 65 20 73 79 73 74 |ecific t|ype syst|
|00003050| 65 6d 20 66 6f 72 20 74 | 68 65 20 67 69 76 65 6e |em for t|he given|
|00003060| 0a 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 2e |.impleme|ntation.|
|00003070| 20 20 46 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 69 | For ex|ample, i|
|00003080| 66 20 61 6e 20 69 6d 70 | 6c 65 6d 65 6e 74 61 74 |f an imp|lementat|
|00003090| 69 6f 6e 20 63 61 6e 20 | 74 65 73 74 20 73 6f 6d |ion can |test som|
|000030a0| 65 20 74 79 70 65 73 20 | 77 69 74 68 20 61 0a 73 |e types |with a.s|
|000030b0| 69 6d 70 6c 65 20 74 61 | 67 20 63 68 65 63 6b 2c |imple ta|g check,|
|000030c0| 20 62 75 74 20 6f 74 68 | 65 72 20 74 79 70 65 73 | but oth|er types|
|000030d0| 20 72 65 71 75 69 72 65 | 20 72 65 61 64 69 6e 67 | require| reading|
|000030e0| 20 61 20 66 69 65 6c 64 | 20 66 72 6f 6d 20 74 68 | a field| from th|
|000030f0| 65 20 6f 62 6a 65 63 74 | 20 69 6e 0a 61 64 64 69 |e object| in.addi|
|00003100| 74 69 6f 6e 2c 20 74 68 | 65 6e 20 74 68 65 20 74 |tion, th|en the t|
|00003110| 77 6f 20 64 69 66 66 65 | 72 65 6e 74 20 6b 69 6e |wo diffe|rent kin|
|00003120| 64 73 20 6f 66 20 63 68 | 65 63 6b 73 20 73 68 6f |ds of ch|ecks sho|
|00003130| 75 6c 64 20 62 65 20 64 | 69 73 74 69 6e 63 74 20 |uld be d|istinct |
|00003140| 61 74 20 74 68 65 20 56 | 4f 50 0a 6c 65 76 65 6c |at the V|OP.level|
|00003150| 2c 20 73 69 6e 63 65 20 | 74 68 69 73 20 77 69 6c |, since |this wil|
|00003160| 6c 20 61 6c 6c 6f 77 20 | 74 68 65 20 56 4f 50 20 |l allow |the VOP |
|00003170| 63 6f 73 74 20 61 6e 64 | 20 73 74 6f 72 61 67 65 |cost and| storage|
|00003180| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 74 6f 20 | informa|tion to |
|00003190| 62 65 20 6d 6f 72 65 0a | 61 63 63 75 72 61 74 65 |be more.|accurate|
|000031a0| 2e 20 20 47 65 6e 65 72 | 61 74 69 6f 6e 20 6f 66 |. Gener|ation of|
|000031b0| 20 74 79 70 65 20 74 65 | 73 74 73 20 73 68 6f 75 | type te|sts shou|
|000031c0| 6c 64 20 62 65 20 66 61 | 63 74 6f 72 65 64 20 6f |ld be fa|ctored o|
|000031d0| 75 74 20 6f 66 20 63 6f | 64 65 20 77 68 69 63 68 |ut of co|de which|
|000031e0| 20 77 6f 75 6c 64 0a 6f | 74 68 65 72 77 69 73 65 | would.o|therwise|
|000031f0| 20 62 65 20 6d 6f 72 65 | 20 70 6f 72 74 61 62 6c | be more| portabl|
|00003200| 65 2e 20 20 50 72 6f 62 | 61 62 6c 79 20 74 68 65 |e. Prob|ably the|
|00003210| 20 49 52 32 20 74 72 61 | 6e 73 6c 61 74 6f 72 20 | IR2 tra|nslator |
|00003220| 66 6f 72 20 54 59 50 45 | 50 20 61 6e 64 20 74 68 |for TYPE|P and th|
|00003230| 65 20 74 79 70 65 0a 63 | 68 65 63 6b 20 67 65 6e |e type.c|heck gen|
|00003240| 65 72 61 74 69 6f 6e 20 | 63 6f 64 65 20 61 72 65 |eration |code are|
|00003250| 20 74 68 65 20 6f 6e 6c | 79 20 70 6c 61 63 65 73 | the onl|y places|
|00003260| 20 74 68 61 74 20 73 68 | 6f 75 6c 64 20 6b 6e 6f | that sh|ould kno|
|00003270| 77 20 61 62 6f 75 74 20 | 68 6f 77 20 74 79 70 65 |w about |how type|
|00003280| 20 74 65 73 74 73 0a 61 | 72 65 20 72 65 70 72 65 | tests.a|re repre|
|00003290| 73 65 6e 74 65 64 20 69 | 6e 20 49 52 32 2e 0a 0a |sented i|n IR2...|
|000032a0| 69 66 2d 74 79 70 65 20 | 28 6f 62 6a 65 63 74 29 |if-type |(object)|
|000032b0| 0a 69 66 2d 74 79 70 65 | 2d 72 61 6e 67 65 0a 20 |.if-type|-range. |
|000032c0| 20 20 20 49 66 2d 54 79 | 70 65 20 54 65 73 74 73 | If-Ty|pe Tests|
|000032d0| 20 77 68 65 74 68 65 72 | 20 4f 62 6a 65 63 74 20 | whether| Object |
|000032e0| 68 61 73 20 74 68 65 20 | 74 79 70 65 20 63 6f 64 |has the |type cod|
|000032f0| 65 20 74 68 61 74 20 69 | 73 20 70 61 73 73 65 64 |e that i|s passed|
|00003300| 20 69 6e 20 74 68 65 0a | 20 20 20 20 63 6f 64 65 | in the.| code|
|00003310| 67 65 6e 20 69 6e 66 6f | 2e 20 20 49 66 2d 54 79 |gen info|. If-Ty|
|00003320| 70 65 2d 52 61 6e 67 65 | 20 74 65 73 74 73 20 66 |pe-Range| tests f|
|00003330| 6f 72 20 61 20 72 61 6e | 67 65 20 6f 66 20 74 79 |or a ran|ge of ty|
|00003340| 70 65 20 63 6f 64 65 73 | 2e 0a 0a 7b 73 6d 61 6c |pe codes|...{smal|
|00003350| 6c 2c 20 66 61 73 74 7d | 20 69 66 2d 76 65 63 74 |l, fast}| if-vect|
|00003360| 6f 72 2d 74 79 70 65 20 | 28 6f 62 6a 65 63 74 29 |or-type |(object)|
|00003370| 0a 20 20 20 20 54 65 73 | 74 20 74 68 61 74 20 4f |. Tes|t that O|
|00003380| 62 6a 65 63 74 20 69 73 | 20 65 69 74 68 65 72 20 |bject is| either |
|00003390| 6f 66 20 74 68 65 20 73 | 70 65 63 69 66 69 65 64 |of the s|pecified|
|000033a0| 20 74 79 70 65 20 63 6f | 64 65 2c 20 6f 72 20 69 | type co|de, or i|
|000033b0| 73 20 61 20 31 64 20 61 | 72 72 61 79 0a 20 20 20 |s a 1d a|rray. |
|000033c0| 20 68 65 61 64 65 72 20 | 77 69 74 68 20 64 61 74 | header |with dat|
|000033d0| 61 20 68 61 76 69 6e 67 | 20 74 68 65 20 73 70 65 |a having| the spe|
|000033e0| 63 69 66 69 65 64 20 74 | 79 70 65 20 63 6f 64 65 |cified t|ype code|
|000033f0| 2e 0a 0a 69 66 2d 76 65 | 63 74 6f 72 2d 73 75 62 |...if-ve|ctor-sub|
|00003400| 74 79 70 65 20 28 6f 62 | 6a 65 63 74 29 0a 20 20 |type (ob|ject). |
|00003410| 20 20 54 65 73 74 20 74 | 68 65 20 73 75 62 74 79 | Test t|he subty|
|00003420| 70 65 20 66 69 65 6c 64 | 20 6f 66 20 61 20 76 65 |pe field| of a ve|
|00003430| 63 74 6f 72 2d 6c 69 6b | 65 20 6f 62 6a 65 63 74 |ctor-lik|e object|
|00003440| 2e 20 20 49 74 20 69 73 | 20 61 73 73 75 6d 65 64 |. It is| assumed|
|00003450| 20 74 68 61 74 20 74 68 | 65 0a 20 20 20 20 6f 62 | that th|e. ob|
|00003460| 6a 65 63 74 20 68 61 73 | 20 61 6c 72 65 61 64 79 |ject has| already|
|00003470| 20 62 65 65 6e 20 64 65 | 74 65 72 6d 69 6e 65 64 | been de|termined|
|00003480| 20 74 6f 20 62 65 20 76 | 65 63 74 6f 72 2d 6c 69 | to be v|ector-li|
|00003490| 6b 65 2e 0a 0a 69 66 2d | 66 69 78 6e 75 6d 70 20 |ke...if-|fixnump |
|000034a0| 28 6f 62 6a 65 63 74 29 | 0a 69 66 2d 73 68 6f 72 |(object)|.if-shor|
|000034b0| 74 2d 66 6c 6f 61 74 2d | 70 0a 69 66 2d 63 68 61 |t-float-|p.if-cha|
|000034c0| 72 61 63 74 65 72 70 0a | 20 20 20 20 54 68 65 20 |racterp.| The |
|000034d0| 72 61 74 69 6f 6e 61 6c | 65 20 62 65 68 69 6e 64 |rational|e behind|
|000034e0| 20 68 61 76 69 6e 67 20 | 74 68 65 73 65 20 61 73 | having |these as|
|000034f0| 20 73 65 70 61 72 61 74 | 65 20 56 4f 50 73 20 69 | separat|e VOPs i|
|00003500| 73 20 74 68 61 74 20 74 | 68 65 79 20 61 72 65 20 |s that t|hey are |
|00003510| 6c 69 6b 65 6c 79 0a 20 | 20 20 20 74 6f 20 62 65 |likely. | to be|
|00003520| 20 69 6d 6d 65 64 69 61 | 74 65 20 74 79 70 65 73 | immedia|te types|
|00003530| 2c 20 61 6e 64 20 74 68 | 75 73 20 6d 61 79 20 68 |, and th|us may h|
|00003540| 61 76 65 20 62 69 7a 7a | 61 72 65 20 74 79 70 65 |ave bizz|are type|
|00003550| 20 73 63 68 65 6d 65 73 | 2e 0a 0a 69 66 2d 63 6f | schemes|...if-co|
|00003560| 6e 73 70 20 28 6f 62 6a | 65 63 74 29 0a 69 66 2d |nsp (obj|ect).if-|
|00003570| 6c 69 73 74 70 0a 20 20 | 20 20 57 65 20 68 61 76 |listp. | We hav|
|00003580| 65 20 64 69 73 74 69 6e | 63 74 20 6f 70 65 72 61 |e distin|ct opera|
|00003590| 74 69 6f 6e 73 20 66 6f | 72 20 74 68 65 73 65 20 |tions fo|r these |
|000035a0| 70 72 65 64 69 63 61 74 | 65 73 20 73 69 6e 63 65 |predicat|es since|
|000035b0| 20 6f 6e 65 20 6f 72 20 | 74 68 65 20 6f 74 68 65 | one or |the othe|
|000035c0| 72 0a 20 20 20 20 69 73 | 6e 27 74 20 61 20 73 69 |r. is|n't a si|
|000035d0| 6d 70 6c 65 20 74 61 67 | 20 74 65 73 74 2c 20 62 |mple tag| test, b|
|000035e0| 75 74 20 77 65 20 64 6f | 6e 27 74 20 6b 6e 6f 77 |ut we do|n't know|
|000035f0| 20 77 68 69 63 68 20 6f | 6e 65 2e 0a 0a 69 66 2d | which o|ne...if-|
|00003600| 72 61 74 69 6f 6e 61 6c | 70 20 28 6f 62 6a 65 63 |rational|p (objec|
|00003610| 74 29 0a 69 66 2d 66 6c | 6f 61 74 70 0a 69 66 2d |t).if-fl|oatp.if-|
|00003620| 69 6e 74 65 67 65 72 70 | 0a 69 66 2d 6e 75 6d 62 |integerp|.if-numb|
|00003630| 65 72 70 0a 69 66 2d 76 | 65 63 74 6f 72 70 0a 69 |erp.if-v|ectorp.i|
|00003640| 66 2d 66 75 6e 63 74 69 | 6f 6e 70 0a 20 20 20 20 |f-functi|onp. |
|00003650| 54 68 65 20 72 61 74 69 | 6f 6e 61 6c 65 20 62 65 |The rati|onale be|
|00003660| 68 69 6e 64 20 68 61 76 | 69 6e 67 20 74 68 65 73 |hind hav|ing thes|
|00003670| 65 20 6f 70 65 72 61 74 | 69 6f 6e 73 20 69 73 20 |e operat|ions is |
|00003680| 74 68 61 74 20 74 68 65 | 79 20 6d 61 79 20 74 61 |that the|y may ta|
|00003690| 6b 65 20 61 20 6c 6f 74 | 20 6f 66 0a 20 20 20 20 |ke a lot| of. |
|000036a0| 63 6f 64 65 2c 20 73 6f | 20 69 74 20 69 73 20 72 |code, so| it is r|
|000036b0| 65 61 73 6f 6e 61 62 6c | 65 20 74 6f 20 70 75 74 |easonabl|e to put|
|000036c0| 20 74 68 65 6d 20 6f 75 | 74 20 6f 66 20 6c 69 6e | them ou|t of lin|
|000036d0| 65 2e 0a 0a 0a 0c 0a 5c | 73 65 63 74 69 6f 6e 7b |e......\|section{|
|000036e0| 54 79 70 65 20 53 75 62 | 2d 70 72 69 6d 69 74 69 |Type Sub|-primiti|
|000036f0| 76 65 73 7d 0a 0a 63 68 | 61 6e 67 65 2d 74 79 70 |ves}..ch|ange-typ|
|00003700| 65 20 28 6f 62 6a 65 63 | 74 29 20 3d 3e 20 72 65 |e (objec|t) => re|
|00003710| 73 75 6c 74 0a 20 20 20 | 20 43 68 61 6e 67 65 20 |sult. | Change |
|00003720| 74 68 65 20 74 79 70 65 | 20 6f 66 20 61 6e 20 6f |the type| of an o|
|00003730| 62 6a 65 63 74 20 61 63 | 63 6f 72 64 69 6e 67 20 |bject ac|cording |
|00003740| 74 6f 20 63 6f 64 65 67 | 65 6e 20 69 6e 66 6f 2e |to codeg|en info.|
|00003750| 20 20 54 68 65 20 6d 65 | 61 6e 69 6e 67 20 6f 66 | The me|aning of|
|00003760| 0a 20 20 20 20 74 68 69 | 73 20 69 73 20 68 69 67 |. thi|s is hig|
|00003770| 68 6c 79 20 74 79 70 65 | 2d 73 79 73 74 65 6d 20 |hly type|-system |
|00003780| 64 65 70 65 6e 64 65 6e | 74 2c 20 62 75 74 20 69 |dependen|t, but i|
|00003790| 74 20 64 6f 65 73 6e 27 | 74 20 6d 61 74 74 65 72 |t doesn'|t matter|
|000037a0| 2c 20 73 69 6e 63 65 20 | 74 68 65 0a 20 20 20 20 |, since |the. |
|000037b0| 63 6f 6d 70 69 6c 65 72 | 20 77 69 6c 6c 20 6e 65 |compiler| will ne|
|000037c0| 76 65 72 20 65 6d 69 74 | 20 74 68 69 73 20 56 4f |ver emit| this VO|
|000037d0| 50 20 64 69 72 65 63 74 | 6c 79 2e 20 20 54 68 65 |P direct|ly. The|
|000037e0| 20 6f 6e 6c 79 20 77 61 | 79 20 74 68 61 74 20 69 | only wa|y that i|
|000037f0| 74 20 63 61 6e 20 73 68 | 6f 77 0a 20 20 20 20 75 |t can sh|ow. u|
|00003800| 70 20 69 73 20 74 68 72 | 6f 75 67 68 20 25 50 72 |p is thr|ough %Pr|
|00003810| 69 6d 69 74 69 76 65 2e | 0a 67 65 74 2d 74 79 70 |imitive.|.get-typ|
|00003820| 65 0a 0a 0a 53 74 6f 72 | 61 67 65 20 72 65 73 6f |e...Stor|age reso|
|00003830| 75 72 63 65 73 3a 0a 0a | 42 6f 78 65 64 20 61 6e |urces:..|Boxed an|
|00003840| 64 20 75 6e 62 6f 78 65 | 64 20 6c 6f 63 61 74 69 |d unboxe|d locati|
|00003850| 6f 6e 73 3a 0a 4e 6f 6e | 2d 69 6d 6d 65 64 69 61 |ons:.Non|-immedia|
|00003860| 74 65 20 6f 62 6a 65 63 | 74 73 20 6d 61 79 20 6e |te objec|ts may n|
|00003870| 6f 74 20 62 65 20 73 74 | 6f 72 65 64 20 69 6e 20 |ot be st|ored in |
|00003880| 75 6e 62 6f 78 65 64 20 | 6c 6f 63 61 74 69 6f 6e |unboxed |location|
|00003890| 73 2e 0a 54 68 69 6e 67 | 73 20 6e 6f 74 20 6c 69 |s..Thing|s not li|
|000038a0| 73 70 20 6f 62 6a 65 63 | 74 73 20 6d 61 79 20 6e |sp objec|ts may n|
|000038b0| 6f 74 20 62 65 20 73 74 | 6f 72 65 64 20 69 6e 20 |ot be st|ored in |
|000038c0| 62 6f 78 65 64 20 6c 6f | 63 61 74 69 6f 6e 73 2e |boxed lo|cations.|
|000038d0| 0a 0a 43 6f 6e 74 72 6f | 6c 20 73 74 61 63 6b 20 |..Contro|l stack |
|000038e0| 69 73 20 62 6f 78 65 64 | 2e 0a 4f 70 74 69 6f 6e |is boxed|..Option|
|000038f0| 61 6c 20 6e 75 6d 62 65 | 72 20 73 74 61 63 6b 20 |al numbe|r stack |
|00003900| 69 73 20 75 6e 62 6f 78 | 65 64 2e 0a 48 65 61 70 |is unbox|ed..Heap|
|00003910| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 20 69 73 20 | environ|ment is |
|00003920| 62 6f 78 65 64 2e 0a 46 | 69 78 65 64 20 6e 75 6d |boxed..F|ixed num|
|00003930| 62 65 72 20 6f 66 20 72 | 65 67 69 73 74 65 72 73 |ber of r|egisters|
|00003940| 2c 20 73 6f 6d 65 20 62 | 6f 78 65 64 20 61 6e 64 |, some b|oxed and|
|00003950| 20 73 6f 6d 65 20 75 6e | 62 6f 78 65 64 2e 0a 0a | some un|boxed...|
|00003960| 50 43 73 20 6d 61 79 20 | 62 65 20 73 74 6f 72 65 |PCs may |be store|
|00003970| 64 20 6f 6e 20 74 68 65 | 20 63 6f 6e 74 72 6f 6c |d on the| control|
|00003980| 20 73 74 61 63 6b 20 6f | 72 20 69 6e 20 62 6f 78 | stack o|r in box|
|00003990| 65 64 20 72 65 67 69 73 | 74 65 72 73 2c 20 73 75 |ed regis|ters, su|
|000039a0| 62 6a 65 63 74 20 74 6f | 20 74 68 65 0a 63 6f 6e |bject to| the.con|
|000039b0| 73 74 72 61 69 6e 74 20 | 74 68 61 74 20 61 20 63 |straint |that a c|
|000039c0| 6f 72 72 65 73 70 6f 6e | 64 69 6e 67 20 65 6e 76 |orrespon|ding env|
|000039d0| 69 72 6f 6e 6d 65 6e 74 | 20 69 73 20 61 6c 73 6f |ironment| is also|
|000039e0| 20 73 74 6f 72 65 64 2e | 20 20 4c 6f 63 61 74 69 | stored.| Locati|
|000039f0| 6f 6e 73 0a 63 6f 6e 74 | 61 69 6e 69 6e 67 20 50 |ons.cont|aining P|
|00003a00| 43 73 20 64 6f 6e 27 74 | 20 6e 65 65 64 20 74 6f |Cs don't| need to|
|00003a10| 20 62 65 20 7a 65 72 6f | 65 64 20 77 68 65 6e 20 | be zero|ed when |
|00003a20| 74 68 65 79 20 61 72 65 | 20 6e 6f 20 6c 6f 6e 67 |they are| no long|
|00003a30| 65 72 20 75 73 65 64 3b | 20 6e 6f 74 68 69 6e 67 |er used;| nothing|
|00003a40| 0a 62 61 64 20 77 69 6c | 6c 20 68 61 70 70 65 6e |.bad wil|l happen|
|00003a50| 20 69 66 20 61 6e 20 6f | 6c 64 20 50 43 20 69 73 | if an o|ld PC is|
|00003a60| 20 75 6e 61 63 63 6f 6d | 70 61 6e 69 65 64 20 62 | unaccom|panied b|
|00003a70| 79 20 61 6e 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |y an env|ironment|
|00003a80| 2e 0a 0a 0a 5c 69 74 65 | 6d 5b 54 72 61 70 5d 49 |....\ite|m[Trap]I|
|00003a90| 6c 6c 65 67 61 6c 20 6f | 62 6a 65 63 74 20 74 72 |llegal o|bject tr|
|00003aa0| 61 70 2e 20 20 54 68 69 | 73 20 76 61 6c 75 65 20 |ap. Thi|s value |
|00003ab0| 69 73 20 75 73 65 64 20 | 69 6e 20 73 79 6d 62 6f |is used |in symbo|
|00003ac0| 6c 73 20 74 6f 20 73 69 | 67 6e 69 66 79 20 61 6e |ls to si|gnify an|
|00003ad0| 0a 75 6e 64 65 66 69 6e | 65 64 20 76 61 6c 75 65 |.undefin|ed value|
|00003ae0| 20 6f 72 20 64 65 66 69 | 6e 69 74 69 6f 6e 2e 0a | or defi|nition..|
|00003af0| 0a 0c 0a 5c 63 68 61 70 | 74 65 72 7b 43 68 61 72 |...\chap|ter{Char|
|00003b00| 61 63 74 65 72 73 7d 0a | 0a 0a 43 68 61 72 61 63 |acters}.|..Charac|
|00003b10| 74 65 72 20 69 73 20 61 | 6e 20 69 6d 6d 65 64 69 |ter is a|n immedi|
|00003b20| 61 74 65 20 74 79 70 65 | 2e 20 20 43 68 61 72 61 |ate type|. Chara|
|00003b30| 63 74 65 72 73 20 61 72 | 65 20 6d 61 6e 69 70 75 |cters ar|e manipu|
|00003b40| 6c 61 74 65 64 20 70 72 | 69 6d 61 72 69 6c 79 20 |lated pr|imarily |
|00003b50| 62 79 0a 63 6f 6e 76 65 | 72 74 69 6e 67 20 69 6e |by.conve|rting in|
|00003b60| 74 6f 20 61 6e 20 69 6e | 74 65 67 65 72 20 61 6e |to an in|teger an|
|00003b70| 64 20 61 63 63 65 73 73 | 69 6e 67 20 74 68 65 73 |d access|ing thes|
|00003b80| 65 20 66 69 65 6c 64 73 | 3a 0a 5c 62 65 67 69 6e |e fields|:.\begin|
|00003b90| 7b 64 65 73 63 72 69 70 | 74 69 6f 6e 7d 0a 5c 69 |{descrip|tion}.\i|
|00003ba0| 74 65 6d 5b 7b 5c 74 74 | 20 25 63 68 61 72 61 63 |tem[{\tt| %charac|
|00003bb0| 74 65 72 2d 63 6f 64 65 | 2d 62 79 74 65 7d 5d 54 |ter-code|-byte}]T|
|00003bc0| 68 65 20 63 68 61 72 61 | 63 74 65 72 20 63 6f 64 |he chara|cter cod|
|00003bd0| 65 2e 20 20 54 68 69 73 | 20 69 73 20 65 66 66 65 |e. This| is effe|
|00003be0| 63 74 69 76 65 6c 79 20 | 72 65 71 75 69 72 65 64 |ctively |required|
|00003bf0| 20 74 6f 0a 73 74 61 72 | 74 20 61 74 20 62 69 74 | to.star|t at bit|
|00003c00| 20 30 2c 20 73 69 6e 63 | 65 20 5c 63 6c 20 65 71 | 0, sinc|e \cl eq|
|00003c10| 75 61 74 65 73 20 7b 5c | 74 74 20 63 68 61 72 2d |uates {\|tt char-|
|00003c20| 69 6e 74 7d 20 74 6f 20 | 7b 5c 74 74 20 63 68 61 |int} to |{\tt cha|
|00003c30| 72 2d 63 6f 64 65 7d 20 | 77 68 65 6e 20 74 68 65 |r-code} |when the|
|00003c40| 72 65 20 69 73 0a 6e 6f | 20 62 69 74 73 20 6f 72 |re is.no| bits or|
|00003c50| 20 66 6f 6e 74 2e 20 20 | 41 6c 6c 20 63 75 72 72 | font. |All curr|
|00003c60| 65 6e 74 20 5c 63 63 6c | 20 73 79 73 74 65 6d 73 |ent \ccl| systems|
|00003c70| 20 75 73 65 20 41 53 43 | 49 49 20 66 6f 72 20 74 | use ASC|II for t|
|00003c80| 68 65 20 63 68 61 72 61 | 63 74 65 72 20 63 6f 64 |he chara|cter cod|
|00003c90| 65 73 2c 0a 61 6e 64 20 | 64 65 66 69 6e 65 20 7b |es,.and |define {|
|00003ca0| 5c 74 74 20 5c 23 5c 6e | 65 77 6c 69 6e 65 7d 20 |\tt \#\n|ewline} |
|00003cb0| 74 6f 20 62 65 20 61 20 | 6c 69 6e 65 66 65 65 64 |to be a |linefeed|
|00003cc0| 2c 20 62 75 74 20 73 79 | 73 74 65 6d 20 63 6f 64 |, but sy|stem cod|
|00003cd0| 65 20 73 68 6f 75 6c 64 | 20 6e 6f 74 20 63 6f 75 |e should| not cou|
|00003ce0| 6e 74 20 6f 6e 0a 74 68 | 69 73 2e 0a 0a 5c 69 74 |nt on.th|is...\it|
|00003cf0| 65 6d 5b 7b 5c 74 74 20 | 25 63 68 61 72 61 63 74 |em[{\tt |%charact|
|00003d00| 65 72 2d 63 6f 6e 74 72 | 6f 6c 2d 62 79 74 65 7d |er-contr|ol-byte}|
|00003d10| 5d 54 68 65 20 63 68 61 | 72 61 63 74 65 72 20 62 |]The cha|racter b|
|00003d20| 69 74 73 2e 20 20 43 68 | 61 72 61 63 74 65 72 20 |its. Ch|aracter |
|00003d30| 62 69 74 73 20 61 72 65 | 20 75 73 65 64 20 62 79 |bits are| used by|
|00003d40| 0a 48 65 6d 6c 6f 63 6b | 20 74 6f 20 64 65 73 63 |.Hemlock| to desc|
|00003d50| 72 69 62 65 20 6d 6f 64 | 69 66 69 65 72 73 20 69 |ribe mod|ifiers i|
|00003d60| 6e 20 6b 65 79 62 6f 61 | 72 64 20 65 76 65 6e 74 |n keyboa|rd event|
|00003d70| 73 2c 20 62 75 74 20 74 | 68 65 72 65 20 69 73 20 |s, but t|here is |
|00003d80| 6e 6f 20 61 73 73 75 6d | 70 74 69 6f 6e 20 6f 66 |no assum|ption of|
|00003d90| 0a 61 6e 79 20 67 65 6e | 65 72 61 6c 20 70 6f 72 |.any gen|eral por|
|00003da0| 74 61 62 6c 65 20 73 69 | 67 6e 69 66 69 63 61 6e |table si|gnifican|
|00003db0| 63 65 20 6f 66 20 63 68 | 61 72 61 63 74 65 72 20 |ce of ch|aracter |
|00003dc0| 62 69 74 73 2e 0a 0a 7b | 5c 74 74 20 25 63 68 61 |bits...{|\tt %cha|
|00003dd0| 72 61 63 74 65 72 2d 66 | 6f 6e 74 2d 62 79 74 65 |racter-f|ont-byte|
|00003de0| 7d 5c 5c 54 68 65 20 63 | 68 61 72 61 63 74 65 72 |}\\The c|haracter|
|00003df0| 20 66 6f 6e 74 2e 20 20 | 54 68 69 73 20 69 73 20 | font. |This is |
|00003e00| 6e 6f 74 20 75 73 65 64 | 20 62 79 20 5c 63 63 6c |not used| by \ccl|
|00003e10| 2c 20 61 6e 64 20 69 73 | 0a 6e 6f 74 20 70 61 72 |, and is|.not par|
|00003e20| 74 69 63 75 6c 61 72 6c | 79 20 75 73 65 66 75 6c |ticularl|y useful|
|00003e30| 2e 0a 5c 65 6e 64 7b 64 | 65 73 63 72 69 70 74 69 |..\end{d|escripti|
|00003e40| 6f 6e 7d 0a 0a 43 68 61 | 72 61 63 74 65 72 73 20 |on}..Cha|racters |
|00003e50| 73 68 6f 75 6c 64 20 62 | 65 20 63 6f 6e 76 65 72 |should b|e conver|
|00003e60| 74 65 64 20 74 6f 20 61 | 6e 64 20 66 72 6f 6d 20 |ted to a|nd from |
|00003e70| 69 6e 74 65 67 65 72 73 | 20 62 79 20 75 73 69 6e |integers| by usin|
|00003e80| 67 20 74 68 65 20 5c 63 | 6c 69 73 70 0a 7b 5c 74 |g the \c|lisp.{\t|
|00003e90| 74 20 63 68 61 72 2d 69 | 6e 74 7d 20 61 6e 64 20 |t char-i|nt} and |
|00003ea0| 7b 5c 74 74 20 69 6e 74 | 2d 63 68 61 72 7d 20 66 |{\tt int|-char} f|
|00003eb0| 75 6e 63 74 69 6f 6e 73 | 2c 20 77 68 69 63 68 20 |unctions|, which |
|00003ec0| 74 68 65 20 63 6f 6d 70 | 69 6c 65 72 20 74 72 61 |the comp|iler tra|
|00003ed0| 6e 73 6c 61 74 65 73 20 | 69 6e 74 6f 0a 74 68 65 |nslates |into.the|
|00003ee0| 73 65 20 56 4f 50 73 3a | 0a 5c 62 65 67 69 6e 7b |se VOPs:|.\begin{|
|00003ef0| 65 78 61 6d 70 6c 65 7d | 0a 63 68 61 72 2d 69 6e |example}|.char-in|
|00003f00| 74 20 28 63 68 61 72 29 | 20 3d 3e 20 69 6e 74 0a |t (char)| => int.|
|00003f10| 69 6e 74 2d 63 68 61 72 | 20 28 69 6e 74 29 20 3d |int-char| (int) =|
|00003f20| 3e 20 63 68 61 72 0a 5c | 65 6e 64 7b 65 78 61 6d |> char.\|end{exam|
|00003f30| 70 6c 65 7d 0a 49 6e 20 | 74 68 65 20 63 6f 6d 6d |ple}.In |the comm|
|00003f40| 6f 6e 20 63 61 73 65 20 | 77 68 65 72 65 20 43 68 |on case |where Ch|
|00003f50| 61 72 20 69 73 20 6b 6e | 6f 77 6e 20 74 6f 20 62 |ar is kn|own to b|
|00003f60| 65 20 61 20 7b 5c 74 74 | 20 73 74 72 69 6e 67 2d |e a {\tt| string-|
|00003f70| 63 68 61 72 7d 2c 20 74 | 68 65 73 65 0a 6f 70 65 |char}, t|hese.ope|
|00003f80| 72 61 74 69 6f 6e 73 20 | 61 72 65 20 65 71 75 69 |rations |are equi|
|00003f90| 76 61 6c 65 6e 74 20 74 | 6f 20 7b 5c 74 74 20 63 |valent t|o {\tt c|
|00003fa0| 68 61 72 2d 63 6f 64 65 | 7d 20 61 6e 64 20 7b 5c |har-code|} and {\|
|00003fb0| 74 74 20 63 6f 64 65 2d | 63 68 61 72 7d 2e 20 20 |tt code-|char}. |
|00003fc0| 49 6e 20 61 64 64 69 74 | 69 6f 6e 20 74 6f 0a 70 |In addit|ion to.p|
|00003fd0| 72 6f 76 69 64 69 6e 67 | 20 61 20 70 6f 72 74 61 |roviding| a porta|
|00003fe0| 62 6c 65 20 69 6e 74 65 | 72 66 61 63 65 20 74 6f |ble inte|rface to|
|00003ff0| 20 63 68 61 72 61 63 74 | 65 72 20 63 6f 6e 76 65 | charact|er conve|
|00004000| 72 73 69 6f 6e 2c 20 74 | 68 65 20 56 4f 50 20 72 |rsion, t|he VOP r|
|00004010| 65 70 72 65 73 65 6e 74 | 61 74 69 6f 6e 0a 6f 66 |epresent|ation.of|
|00004020| 20 74 68 69 73 20 74 79 | 70 65 20 63 6f 6e 76 65 | this ty|pe conve|
|00004030| 72 73 69 6f 6e 20 61 6c | 6c 6f 77 73 20 74 68 65 |rsion al|lows the|
|00004040| 20 63 6f 6d 70 69 6c 65 | 72 20 74 6f 20 61 76 6f | compile|r to avo|
|00004050| 69 64 20 75 6e 6e 65 63 | 65 73 73 61 72 79 20 62 |id unnec|essary b|
|00004060| 6f 78 69 6e 67 20 61 6e | 64 0a 75 6e 62 6f 78 69 |oxing an|d.unboxi|
|00004070| 6e 67 20 6f 66 20 63 68 | 61 72 61 63 74 65 72 20 |ng of ch|aracter |
|00004080| 6f 62 6a 65 63 74 73 2e | 0a 0a 45 78 69 73 74 69 |objects.|..Existi|
|00004090| 6e 67 20 63 6f 64 65 20 | 65 78 70 6c 69 63 69 74 |ng code |explicit|
|000040a0| 6c 79 20 63 6f 6e 76 65 | 72 74 73 20 66 69 78 6e |ly conve|rts fixn|
|000040b0| 75 6d 73 20 74 6f 20 63 | 68 61 72 61 63 74 65 72 |ums to c|haracter|
|000040c0| 73 20 62 79 20 75 73 69 | 6e 67 20 74 68 65 0a 4d |s by usi|ng the.M|
|000040d0| 61 6b 65 2d 49 6d 6d 65 | 64 69 61 74 65 2d 54 79 |ake-Imme|diate-Ty|
|000040e0| 70 65 20 73 75 62 2d 70 | 72 69 6d 69 74 69 76 65 |pe sub-p|rimitive|
|000040f0| 20 77 69 74 68 20 25 43 | 68 61 72 61 63 74 65 72 | with %C|haracter|
|00004100| 2d 54 79 70 65 2e 20 20 | 43 75 72 72 65 6e 74 6c |-Type. |Currentl|
|00004110| 79 20 63 6f 6e 76 65 72 | 73 69 6f 6e 0a 6f 66 20 |y conver|sion.of |
|00004120| 63 68 61 72 61 63 74 65 | 72 73 20 74 6f 20 66 69 |characte|rs to fi|
|00004130| 78 6e 75 6d 73 20 69 73 | 20 72 61 74 68 65 72 20 |xnums is| rather |
|00004140| 63 6f 6e 66 75 73 65 64 | 2e 20 20 4f 72 69 67 69 |confused|. Origi|
|00004150| 6e 61 6c 6c 79 2c 20 63 | 68 61 72 61 63 74 65 72 |nally, c|haracter|
|00004160| 73 20 77 65 72 65 20 61 | 0a 73 75 62 74 79 70 65 |s were a|.subtype|
|00004170| 20 6f 66 20 74 68 65 20 | 4d 69 73 63 20 74 79 70 | of the |Misc typ|
|00004180| 65 20 63 6f 64 65 2c 20 | 61 6e 64 20 74 68 65 20 |e code, |and the |
|00004190| 72 65 73 75 6c 74 20 6f | 66 20 74 68 65 20 4d 61 |result o|f the Ma|
|000041a0| 6b 65 2d 46 69 78 6e 75 | 6d 20 73 75 62 2d 70 72 |ke-Fixnu|m sub-pr|
|000041b0| 69 6d 69 74 69 76 65 0a | 68 61 64 20 74 6f 20 62 |imitive.|had to b|
|000041c0| 65 20 6d 61 73 6b 65 64 | 20 77 69 74 68 20 7b 5c |e masked| with {\|
|000041d0| 74 74 20 25 63 68 61 72 | 61 63 74 65 72 2d 69 6e |tt %char|acter-in|
|000041e0| 74 2d 6d 61 73 6b 7d 3b | 20 73 6f 6d 65 20 63 6f |t-mask};| some co|
|000041f0| 64 65 20 73 74 69 6c 6c | 20 64 6f 65 73 20 74 68 |de still| does th|
|00004200| 69 73 2c 20 77 68 69 6c | 65 0a 6f 74 68 65 72 20 |is, whil|e.other |
|00004210| 63 6f 64 65 20 6d 61 79 | 20 6e 6f 74 2e 0a 0a 43 |code may| not...C|
|00004220| 68 61 72 61 63 74 65 72 | 20 63 6f 6d 70 61 72 69 |haracter| compari|
|00004230| 73 6f 6e 73 20 63 6f 75 | 6c 64 20 62 65 20 69 6d |sons cou|ld be im|
|00004240| 70 6c 65 6d 65 6e 74 65 | 64 20 62 79 20 64 6f 69 |plemente|d by doi|
|00004250| 6e 67 20 6e 75 6d 65 72 | 69 63 20 63 6f 6d 70 61 |ng numer|ic compa|
|00004260| 72 69 73 6f 6e 73 20 6f | 6e 20 74 68 65 0a 72 65 |risons o|n the.re|
|00004270| 73 75 6c 74 20 6f 66 20 | 7b 5c 74 74 20 63 68 61 |sult of |{\tt cha|
|00004280| 72 2d 69 6e 74 7d 2c 20 | 6f 72 20 62 79 20 75 73 |r-int}, |or by us|
|00004290| 69 6e 67 20 7b 5c 74 74 | 20 65 71 7d 20 69 6e 20 |ing {\tt| eq} in |
|000042a0| 74 68 65 20 63 61 73 65 | 20 6f 66 20 7b 5c 74 74 |the case| of {\tt|
|000042b0| 20 63 68 61 72 3d 7d 2c | 20 62 75 74 20 74 68 69 | char=},| but thi|
|000042c0| 73 0a 63 61 6e 20 72 65 | 73 75 6c 74 20 69 6e 20 |s.can re|sult in |
|000042d0| 75 6e 6e 65 63 65 73 73 | 61 72 79 20 74 79 70 65 |unnecess|ary type|
|000042e0| 20 63 6f 6e 76 65 72 73 | 69 6f 6e 73 2e 20 20 49 | convers|ions. I|
|000042f0| 6e 73 74 65 61 64 2c 20 | 74 68 65 20 63 6f 6d 70 |nstead, |the comp|
|00004300| 69 6c 65 72 20 75 73 65 | 73 20 74 68 65 73 65 0a |iler use|s these.|
|00004310| 63 6f 6e 64 69 74 69 6f | 6e 61 6c 20 56 4f 50 73 |conditio|nal VOPs|
|00004320| 3a 0a 5c 62 65 67 69 6e | 7b 65 78 61 6d 70 6c 65 |:.\begin|{example|
|00004330| 7d 0a 69 66 2d 63 68 61 | 72 3d 20 28 78 20 79 29 |}.if-cha|r= (x y)|
|00004340| 0a 69 66 2d 63 68 61 72 | 3c 20 28 78 20 79 29 0a |.if-char|< (x y).|
|00004350| 69 66 2d 63 68 61 72 3e | 20 28 78 20 79 29 0a 5c |if-char>| (x y).\|
|00004360| 65 6e 64 7b 65 78 61 6d | 70 6c 65 7d 0a 0a 0c 0a |end{exam|ple}....|
|00004370| 5c 63 68 61 70 74 65 72 | 7b 53 79 6d 62 6f 6c 73 |\chapter|{Symbols|
|00004380| 7d 0a 0a 0a 53 79 6d 62 | 6f 6c 73 20 61 72 65 20 |}...Symb|ols are |
|00004390| 63 75 72 72 65 6e 74 6c | 79 20 66 61 69 72 6c 79 |currentl|y fairly|
|000043a0| 20 62 6f 72 69 6e 67 20 | 69 6e 20 5c 63 63 6c 2c | boring |in \ccl,|
|000043b0| 20 63 6f 6e 74 61 69 6e | 69 6e 67 20 6f 6e 6c 79 | contain|ing only|
|000043c0| 20 74 68 65 20 6f 62 76 | 69 6f 75 73 20 73 6c 6f | the obv|ious slo|
|000043d0| 74 73 3a 0a 5c 62 65 67 | 69 6e 7b 64 65 73 63 72 |ts:.\beg|in{descr|
|000043e0| 69 70 74 69 6f 6e 7d 0a | 7b 5c 74 74 20 25 73 79 |iption}.|{\tt %sy|
|000043f0| 6d 62 6f 6c 2d 76 61 6c | 75 65 2d 73 6c 6f 74 7d |mbol-val|ue-slot}|
|00004400| 5c 5c 54 68 65 20 63 75 | 72 72 65 6e 74 20 64 79 |\\The cu|rrent dy|
|00004410| 6e 61 6d 69 63 20 76 61 | 6c 75 65 20 6f 66 20 74 |namic va|lue of t|
|00004420| 68 69 73 20 73 79 6d 62 | 6f 6c 2e 20 20 49 66 20 |his symb|ol. If |
|00004430| 74 68 65 0a 73 79 6d 62 | 6f 6c 20 69 73 20 63 75 |the.symb|ol is cu|
|00004440| 72 72 65 6e 74 6c 79 20 | 75 6e 62 6f 75 6e 64 2c |rrently |unbound,|
|00004450| 20 74 68 65 6e 20 74 68 | 65 20 76 61 6c 75 65 20 | then th|e value |
|00004460| 6f 66 20 74 68 69 73 20 | 73 6c 6f 74 20 69 73 20 |of this |slot is |
|00004470| 74 68 65 20 75 6e 62 6f | 75 6e 64 20 6d 61 72 6b |the unbo|und mark|
|00004480| 65 72 2e 0a 0a 7b 5c 74 | 74 20 25 73 79 6d 62 6f |er...{\t|t %symbo|
|00004490| 6c 2d 66 75 6e 63 74 69 | 6f 6e 2d 73 6c 6f 74 7d |l-functi|on-slot}|
|000044a0| 5c 5c 54 68 65 20 67 6c | 6f 62 61 6c 20 66 75 6e |\\The gl|obal fun|
|000044b0| 63 74 69 6f 6e 20 66 75 | 6e 63 74 69 6f 6e 20 64 |ction fu|nction d|
|000044c0| 65 66 69 6e 69 74 69 6f | 6e 20 6f 66 20 74 68 69 |efinitio|n of thi|
|000044d0| 73 0a 73 79 6d 62 6f 6c | 2e 20 20 49 66 20 74 68 |s.symbol|. If th|
|000044e0| 65 20 73 79 6d 62 6f 6c | 20 69 73 20 6e 6f 74 20 |e symbol| is not |
|000044f0| 66 62 6f 75 6e 64 2c 20 | 74 68 65 6e 20 74 68 69 |fbound, |then thi|
|00004500| 73 20 73 6c 6f 74 20 68 | 6f 6c 64 73 20 74 68 65 |s slot h|olds the|
|00004510| 20 75 6e 62 6f 75 6e 64 | 20 6d 61 72 6b 65 72 2e | unbound| marker.|
|00004520| 0a 0a 5c 6d 75 6c 74 69 | 70 6c 65 7b 0a 7b 5c 74 |..\multi|ple{.{\t|
|00004530| 74 20 25 73 79 6d 62 6f | 6c 2d 70 6c 69 73 74 2d |t %symbo|l-plist-|
|00004540| 73 6c 6f 74 7d 20 5c 2a | 0a 7b 5c 74 74 20 25 73 |slot} \*|.{\tt %s|
|00004550| 79 6d 62 6f 6c 2d 6e 61 | 6d 65 2d 73 6c 6f 74 7d |ymbol-na|me-slot}|
|00004560| 20 5c 2a 0a 7b 5c 74 74 | 20 25 73 79 6d 62 6f 6c | \*.{\tt| %symbol|
|00004570| 2d 70 61 63 6b 61 67 65 | 2d 73 6c 6f 74 7d 0a 7d |-package|-slot}.}|
|00004580| 5c 5c 54 68 65 20 70 72 | 6f 70 65 72 74 79 20 6c |\\The pr|operty l|
|00004590| 69 73 74 2c 20 70 72 69 | 6e 74 20 6e 61 6d 65 20 |ist, pri|nt name |
|000045a0| 61 6e 64 20 70 61 63 6b | 61 67 65 20 66 6f 72 20 |and pack|age for |
|000045b0| 74 68 69 73 20 73 79 6d | 62 6f 6c 2e 0a 5c 65 6e |this sym|bol..\en|
|000045c0| 64 7b 64 65 73 63 72 69 | 70 74 69 6f 6e 7d 0a 0a |d{descri|ption}..|
|000045d0| 0a 0c 0a 5c 73 65 63 74 | 69 6f 6e 7b 53 75 62 2d |...\sect|ion{Sub-|
|000045e0| 70 72 69 6d 69 74 69 76 | 65 73 7d 0a 0a 54 68 65 |primitiv|es}..The|
|000045f0| 20 7b 5c 74 74 20 61 6c | 6c 6f 63 2d 73 79 6d 62 | {\tt al|loc-symb|
|00004600| 6f 6c 7d 20 73 75 62 2d | 70 72 69 6d 69 74 69 76 |ol} sub-|primitiv|
|00004610| 65 20 61 6c 6c 6f 63 61 | 74 65 73 20 61 20 6e 65 |e alloca|tes a ne|
|00004620| 77 20 73 79 6d 62 6f 6c | 20 6f 62 6a 65 63 74 2e |w symbol| object.|
|00004630| 20 20 7b 5c 69 74 20 6e | 61 6d 65 7d 20 69 73 0a | {\it n|ame} is.|
|00004640| 74 68 65 20 73 69 6d 70 | 6c 65 2d 73 74 72 69 6e |the simp|le-strin|
|00004650| 67 20 74 68 61 74 20 69 | 73 20 74 6f 20 62 65 20 |g that i|s to be |
|00004660| 74 68 65 20 6e 61 6d 65 | 20 6f 66 20 74 68 65 20 |the name| of the |
|00004670| 73 79 6d 62 6f 6c 2e 0a | 5c 62 65 67 69 6e 7b 65 |symbol..|\begin{e|
|00004680| 78 61 6d 70 6c 65 7d 0a | 61 6c 6c 6f 63 2d 73 79 |xample}.|alloc-sy|
|00004690| 6d 62 6f 6c 20 28 6e 61 | 6d 65 29 20 3d 3e 20 73 |mbol (na|me) => s|
|000046a0| 79 6d 62 6f 6c 0a 5c 65 | 6e 64 7b 65 78 61 6d 70 |ymbol.\e|nd{examp|
|000046b0| 6c 65 7d 0a 0a 54 68 65 | 20 7b 5c 74 74 20 73 65 |le}..The| {\tt se|
|000046c0| 74 2d 73 79 6d 62 6f 6c | 2d 70 61 63 6b 61 67 65 |t-symbol|-package|
|000046d0| 7d 20 73 75 62 2d 70 72 | 69 6d 69 74 69 76 65 20 |} sub-pr|imitive |
|000046e0| 69 73 20 75 73 65 64 20 | 62 79 20 73 79 73 74 65 |is used |by syste|
|000046f0| 6d 20 63 6f 64 65 20 74 | 68 61 74 20 6d 75 73 74 |m code t|hat must|
|00004700| 20 73 65 74 0a 74 68 65 | 20 73 79 6d 62 6f 6c 20 | set.the| symbol |
|00004710| 70 61 63 6b 61 67 65 2e | 0a 5c 62 65 67 69 6e 7b |package.|.\begin{|
|00004720| 65 78 61 6d 70 6c 65 7d | 0a 73 65 74 2d 73 79 6d |example}|.set-sym|
|00004730| 62 6f 6c 2d 70 61 63 6b | 61 67 65 20 28 73 79 6d |bol-pack|age (sym|
|00004740| 62 6f 6c 20 6e 65 77 2d | 76 61 6c 75 65 29 0a 5c |bol new-|value).\|
|00004750| 65 6e 64 7b 65 78 61 6d | 70 6c 65 7d 0a 0a 0a 0c |end{exam|ple}....|
|00004760| 0a 5c 73 65 63 74 69 6f | 6e 7b 41 63 63 65 73 73 |.\sectio|n{Access|
|00004770| 6f 72 20 56 4f 50 73 7d | 0a 0a 54 68 65 73 65 20 |or VOPs}|..These |
|00004780| 56 4f 50 73 20 72 65 61 | 64 20 74 68 65 20 67 6c |VOPs rea|d the gl|
|00004790| 6f 62 61 6c 20 73 79 6d | 62 6f 6c 20 76 61 6c 75 |obal sym|bol valu|
|000047a0| 65 20 61 6e 64 20 64 65 | 66 69 6e 69 74 69 6f 6e |e and de|finition|
|000047b0| 20 63 65 6c 6c 73 2e 20 | 20 7b 5c 74 74 20 63 6f | cells. | {\tt co|
|000047c0| 6e 73 74 61 6e 74 2d 72 | 65 66 7d 0a 6d 61 79 20 |nstant-r|ef}.may |
|000047d0| 6f 6e 6c 79 20 62 65 20 | 75 73 65 64 20 6f 6e 20 |only be |used on |
|000047e0| 73 79 6d 62 6f 6c 73 20 | 74 68 61 74 20 68 61 76 |symbols |that hav|
|000047f0| 65 20 62 65 65 6e 20 64 | 65 66 69 6e 65 64 20 74 |e been d|efined t|
|00004800| 6f 20 62 65 20 63 6f 6e | 73 74 61 6e 74 73 2e 20 |o be con|stants. |
|00004810| 20 53 69 6e 63 65 20 61 | 0a 63 6f 6e 73 74 61 6e | Since a|.constan|
|00004820| 74 20 63 61 6e 6e 6f 74 | 20 63 68 61 6e 67 65 20 |t cannot| change |
|00004830| 69 6e 20 76 61 6c 75 65 | 20 61 6e 64 20 63 61 6e |in value| and can|
|00004840| 6e 6f 74 20 62 65 20 64 | 79 6e 61 6d 69 63 61 6c |not be d|ynamical|
|00004850| 6c 79 20 62 6f 75 6e 64 | 2c 20 74 68 65 20 63 6f |ly bound|, the co|
|00004860| 6d 70 69 6c 65 72 0a 6d | 61 79 20 62 65 20 61 62 |mpiler.m|ay be ab|
|00004870| 6c 65 20 74 6f 20 63 6f | 6d 70 69 6c 65 20 75 73 |le to co|mpile us|
|00004880| 65 73 20 6f 66 20 7b 5c | 74 74 20 63 6f 6e 73 74 |es of {\|tt const|
|00004890| 61 6e 74 2d 72 65 66 7d | 20 6d 6f 72 65 20 65 66 |ant-ref}| more ef|
|000048a0| 66 69 63 69 65 6e 74 6c | 79 2e 20 20 55 6e 73 61 |ficientl|y. Unsa|
|000048b0| 66 65 0a 76 65 72 73 69 | 6f 6e 73 20 6f 66 20 74 |fe.versi|ons of t|
|000048c0| 68 65 73 65 20 56 4f 50 | 73 20 6d 61 79 20 6e 6f |hese VOP|s may no|
|000048d0| 74 20 63 68 65 63 6b 20 | 66 6f 72 20 74 68 65 20 |t check |for the |
|000048e0| 73 6c 6f 74 20 62 65 69 | 6e 67 20 75 6e 62 6f 75 |slot bei|ng unbou|
|000048f0| 6e 64 2c 20 77 68 69 63 | 68 20 74 68 65 0a 63 6f |nd, whic|h the.co|
|00004900| 72 72 65 73 70 6f 6e 64 | 69 6e 67 20 5c 63 6c 69 |rrespond|ing \cli|
|00004910| 73 70 20 66 75 6e 63 74 | 69 6f 6e 73 20 61 72 65 |sp funct|ions are|
|00004920| 20 72 65 71 75 69 72 65 | 64 20 74 6f 20 64 6f 2e | require|d to do.|
|00004930| 0a 5c 62 65 67 69 6e 7b | 65 78 61 6d 70 6c 65 7d |.\begin{|example}|
|00004940| 0a 7b 73 6d 61 6c 6c 2c | 20 66 61 73 74 7d 20 73 |.{small,| fast} s|
|00004950| 79 6d 62 6f 6c 2d 76 61 | 6c 75 65 20 28 73 79 6d |ymbol-va|lue (sym|
|00004960| 62 6f 6c 29 20 3d 3e 20 | 76 61 6c 75 65 0a 7b 73 |bol) => |value.{s|
|00004970| 6d 61 6c 6c 2c 20 66 61 | 73 74 7d 20 63 6f 6e 73 |mall, fa|st} cons|
|00004980| 74 61 6e 74 2d 72 65 66 | 20 28 73 79 6d 62 6f 6c |tant-ref| (symbol|
|00004990| 29 20 3d 3e 20 76 61 6c | 75 65 0a 7b 73 6d 61 6c |) => val|ue.{smal|
|000049a0| 6c 2c 20 66 61 73 74 7d | 20 73 79 6d 62 6f 6c 2d |l, fast}| symbol-|
|000049b0| 66 75 6e 63 74 69 6f 6e | 20 28 73 79 6d 62 6f 6c |function| (symbol|
|000049c0| 29 20 3d 3e 20 76 61 6c | 75 65 0a 5c 65 6e 64 7b |) => val|ue.\end{|
|000049d0| 65 78 61 6d 70 6c 65 7d | 0a 0a 54 68 65 73 65 20 |example}|..These |
|000049e0| 56 4f 50 73 20 73 65 74 | 20 74 68 65 20 67 6c 6f |VOPs set| the glo|
|000049f0| 62 61 6c 20 73 79 6d 62 | 6f 6c 20 76 61 6c 75 65 |bal symb|ol value|
|00004a00| 20 61 6e 64 20 64 65 66 | 69 6e 69 74 69 6f 6e 20 | and def|inition |
|00004a10| 63 65 6c 6c 73 2e 20 20 | 7b 5c 74 74 20 6d 61 6b |cells. |{\tt mak|
|00004a20| 75 6e 62 6f 75 6e 64 7d | 0a 61 6e 64 20 7b 5c 74 |unbound}|.and {\t|
|00004a30| 74 20 66 6d 61 6b 75 6e | 62 6f 75 6e 64 7d 20 61 |t fmakun|bound} a|
|00004a40| 72 65 20 69 6d 70 6c 65 | 6d 65 6e 74 65 64 20 62 |re imple|mented b|
|00004a50| 79 20 73 65 74 74 69 6e | 67 20 74 68 65 20 76 61 |y settin|g the va|
|00004a60| 6c 75 65 20 74 6f 20 74 | 68 65 20 75 6e 62 6f 75 |lue to t|he unbou|
|00004a70| 6e 64 20 6d 61 72 6b 65 | 72 2e 0a 5c 62 65 67 69 |nd marke|r..\begi|
|00004a80| 6e 7b 65 78 61 6d 70 6c | 65 7d 0a 7b 73 6d 61 6c |n{exampl|e}.{smal|
|00004a90| 6c 2c 20 66 61 73 74 7d | 20 73 65 74 2d 73 79 6d |l, fast}| set-sym|
|00004aa0| 62 6f 6c 2d 76 61 6c 75 | 65 20 28 73 79 6d 62 6f |bol-valu|e (symbo|
|00004ab0| 6c 20 6e 65 77 2d 76 61 | 6c 75 65 29 0a 7b 73 6d |l new-va|lue).{sm|
|00004ac0| 61 6c 6c 2c 20 66 61 73 | 74 7d 20 73 65 74 2d 73 |all, fas|t} set-s|
|00004ad0| 79 6d 62 6f 6c 2d 66 75 | 6e 63 74 69 6f 6e 20 28 |ymbol-fu|nction (|
|00004ae0| 73 79 6d 62 6f 6c 20 6e | 65 77 2d 76 61 6c 75 65 |symbol n|ew-value|
|00004af0| 29 0a 5c 65 6e 64 7b 65 | 78 61 6d 70 6c 65 7d 0a |).\end{e|xample}.|
|00004b00| 0a 54 68 65 20 5c 63 6c | 69 73 70 20 61 63 63 65 |.The \cl|isp acce|
|00004b10| 73 73 6f 72 73 20 66 6f | 72 20 6f 74 68 65 72 20 |ssors fo|r other |
|00004b20| 73 79 6d 62 6f 6c 20 73 | 6c 6f 74 73 20 61 72 65 |symbol s|lots are|
|00004b30| 20 74 72 61 6e 73 6c 61 | 74 65 64 20 69 6e 74 6f | transla|ted into|
|00004b40| 20 75 73 65 73 20 6f 66 | 20 74 68 65 0a 7b 5c 74 | uses of| the.{\t|
|00004b50| 74 20 73 6c 6f 74 2d 72 | 65 66 7d 20 61 6e 64 20 |t slot-r|ef} and |
|00004b60| 7b 5c 74 74 20 73 6c 6f | 74 2d 73 65 74 7d 20 56 |{\tt slo|t-set} V|
|00004b70| 4f 50 73 2e 0a 0a 0a 0c | 0a 5c 73 65 63 74 69 6f |OPs.....|.\sectio|
|00004b80| 6e 7b 53 70 65 63 69 61 | 6c 20 42 69 6e 64 69 6e |n{Specia|l Bindin|
|00004b90| 67 7d 0a 0a 54 68 65 73 | 65 20 56 4f 50 73 20 69 |g}..Thes|e VOPs i|
|00004ba0| 6d 70 6c 65 6d 65 6e 74 | 20 64 79 6e 61 6d 69 63 |mplement| dynamic|
|00004bb0| 20 62 69 6e 64 69 6e 67 | 20 6f 66 20 73 70 65 63 | binding| of spec|
|00004bc0| 69 61 6c 20 76 61 72 69 | 61 62 6c 65 73 20 75 73 |ial vari|ables us|
|00004bd0| 69 6e 67 20 73 68 61 6c | 6c 6f 77 0a 62 69 6e 64 |ing shal|low.bind|
|00004be0| 69 6e 67 2e 20 20 7b 5c | 74 74 20 62 69 6e 64 7d |ing. {\|tt bind}|
|00004bf0| 20 62 69 6e 64 73 20 7b | 5c 69 74 20 73 79 6d 62 | binds {|\it symb|
|00004c00| 6f 6c 7d 20 74 6f 20 74 | 68 65 20 73 70 65 63 69 |ol} to t|he speci|
|00004c10| 66 69 65 64 20 7b 5c 69 | 74 20 76 61 6c 75 65 7d |fied {\i|t value}|
|00004c20| 2c 20 77 68 69 6c 65 0a | 7b 5c 74 74 20 75 6e 62 |, while.|{\tt unb|
|00004c30| 69 6e 64 7d 20 75 6e 64 | 6f 65 73 20 74 68 65 20 |ind} und|oes the |
|00004c40| 6d 6f 73 74 20 72 65 63 | 65 6e 74 20 7b 5c 69 74 |most rec|ent {\it|
|00004c50| 20 63 6f 75 6e 74 7d 20 | 73 70 65 63 69 61 6c 20 | count} |special |
|00004c60| 62 69 6e 64 69 6e 67 73 | 20 6f 6e 20 74 68 65 20 |bindings| on the |
|00004c70| 62 69 6e 64 69 6e 67 0a | 73 74 61 63 6b 2e 0a 5c |binding.|stack..\|
|00004c80| 62 65 67 69 6e 7b 65 78 | 61 6d 70 6c 65 7d 0a 62 |begin{ex|ample}.b|
|00004c90| 69 6e 64 20 28 73 79 6d | 62 6f 6c 20 76 61 6c 75 |ind (sym|bol valu|
|00004ca0| 65 29 0a 75 6e 62 69 6e | 64 20 28 63 6f 75 6e 74 |e).unbin|d (count|
|00004cb0| 29 0a 5c 65 6e 64 7b 65 | 78 61 6d 70 6c 65 7d 0a |).\end{e|xample}.|
|00004cc0| 0a 0c 0a 5c 73 65 63 74 | 69 6f 6e 7b 50 72 6f 70 |...\sect|ion{Prop|
|00004cd0| 65 72 74 79 20 4c 69 73 | 74 73 7d 0a 0a 54 68 65 |erty Lis|ts}..The|
|00004ce0| 20 7b 5c 74 74 20 67 65 | 74 7d 20 56 4f 50 20 69 | {\tt ge|t} VOP i|
|00004cf0| 6d 70 6c 65 6d 65 6e 74 | 73 20 74 68 65 20 63 6f |mplement|s the co|
|00004d00| 72 72 65 73 70 6f 6e 64 | 69 6e 67 20 5c 63 6c 69 |rrespond|ing \cli|
|00004d10| 73 70 20 66 75 6e 63 74 | 69 6f 6e 2c 20 77 68 69 |sp funct|ion, whi|
|00004d20| 6c 65 20 7b 5c 74 74 20 | 70 75 74 7d 0a 69 6d 70 |le {\tt |put}.imp|
|00004d30| 6c 65 6d 65 6e 74 73 20 | 69 74 73 20 73 65 74 66 |lements |its setf|
|00004d40| 2d 69 6e 76 65 72 73 65 | 2e 0a 5c 62 65 67 69 6e |-inverse|..\begin|
|00004d50| 7b 65 78 61 6d 70 6c 65 | 7d 0a 67 65 74 20 28 73 |{example|}.get (s|
|00004d60| 79 6d 62 6f 6c 20 69 6e | 64 69 63 61 74 6f 72 20 |ymbol in|dicator |
|00004d70| 64 65 66 61 75 6c 74 29 | 20 3d 3e 20 76 61 6c 75 |default)| => valu|
|00004d80| 65 0a 70 75 74 20 28 73 | 79 6d 62 6f 6c 20 69 6e |e.put (s|ymbol in|
|00004d90| 64 69 63 61 74 6f 72 20 | 76 61 6c 75 65 29 0a 5c |dicator |value).\|
|00004da0| 65 6e 64 7b 65 78 61 6d | 70 6c 65 7d 0a 0a 0c 0a |end{exam|ple}....|
|00004db0| 5c 63 68 61 70 74 65 72 | 7b 4c 69 73 74 73 7d 0a |\chapter|{Lists}.|
|00004dc0| 0a 0a 63 6f 6e 73 0a 0a | 6c 69 73 74 3c 6e 3e 20 |..cons..|list<n> |
|00004dd0| 28 65 6c 74 30 20 2e 2e | 2e 20 65 6c 74 3c 6e 2d |(elt0 ..|. elt<n-|
|00004de0| 31 3e 29 20 3d 3e 20 6c | 69 73 74 0a 6c 69 73 74 |1>) => l|ist.list|
|00004df0| 20 28 65 6c 74 30 20 2e | 2e 2e 20 65 6c 74 3c 6e | (elt0 .|.. elt<n|
|00004e00| 2d 31 3e 20 6d 6f 72 65 | 2d 65 6c 74 73 29 20 3d |-1> more|-elts) =|
|00004e10| 3e 20 6c 69 73 74 0a 20 | 20 20 20 46 6f 72 20 73 |> list. | For s|
|00004e20| 6f 6d 65 20 73 6d 61 6c | 6c 20 4e 2c 20 77 65 20 |ome smal|l N, we |
|00004e30| 68 61 76 65 20 66 69 78 | 65 64 2d 61 72 67 20 76 |have fix|ed-arg v|
|00004e40| 65 72 73 69 6f 6e 73 20 | 6f 66 20 4c 69 73 74 2e |ersions |of List.|
|00004e50| 20 20 46 6f 72 20 6c 61 | 72 67 65 72 20 6c 69 73 | For la|rger lis|
|00004e60| 74 73 2c 20 77 65 0a 20 | 20 20 20 70 61 73 73 20 |ts, we. | pass |
|00004e70| 69 6e 20 61 64 64 69 74 | 69 6f 6e 61 6c 20 65 6c |in addit|ional el|
|00004e80| 65 6d 65 6e 74 73 20 69 | 6e 20 61 20 73 74 61 63 |ements i|n a stac|
|00004e90| 6b 20 54 4e 20 28 70 6f | 73 73 69 62 6c 79 20 72 |k TN (po|ssibly r|
|00004ea0| 65 71 75 69 72 65 64 20 | 74 6f 20 62 65 20 6f 6e |equired |to be on|
|00004eb0| 20 73 74 61 63 6b 0a 20 | 20 20 20 74 6f 70 29 2e | stack. | top).|
|00004ec0| 20 20 4c 69 73 74 2a 20 | 69 73 20 73 69 6d 69 6c | List* |is simil|
|00004ed0| 61 72 2e 0a 0a 0a 54 68 | 65 73 65 20 56 4f 50 73 |ar....Th|ese VOPs|
|00004ee0| 20 69 6d 70 6c 65 6d 65 | 6e 74 20 74 68 65 20 63 | impleme|nt the c|
|00004ef0| 6f 72 72 65 73 70 6f 6e | 64 69 6e 67 20 5c 63 6c |orrespon|ding \cl|
|00004f00| 69 73 70 20 66 75 6e 63 | 74 69 6f 6e 73 3a 0a 5c |isp func|tions:.\|
|00004f10| 62 65 67 69 6e 7b 65 78 | 61 6d 70 6c 65 7d 0a 7b |begin{ex|ample}.{|
|00004f20| 73 6d 61 6c 6c 2c 20 66 | 61 73 74 7d 20 63 61 72 |small, f|ast} car|
|00004f30| 20 28 6c 69 73 74 29 20 | 3d 3e 20 76 61 6c 75 65 | (list) |=> value|
|00004f40| 20 0a 7b 73 6d 61 6c 6c | 2c 20 66 61 73 74 7d 20 | .{small|, fast} |
|00004f50| 63 64 72 20 28 6c 69 73 | 74 29 20 3d 3e 20 76 61 |cdr (lis|t) => va|
|00004f60| 6c 75 65 20 0a 5c 65 6e | 64 7b 65 78 61 6d 70 6c |lue .\en|d{exampl|
|00004f70| 65 7d 0a 0a 54 68 65 73 | 65 20 56 4f 50 73 20 73 |e}..Thes|e VOPs s|
|00004f80| 65 74 20 74 68 65 20 63 | 61 72 20 6f 72 20 63 64 |et the c|ar or cd|
|00004f90| 72 20 6f 66 20 61 20 63 | 6f 6e 73 3a 0a 5c 62 65 |r of a c|ons:.\be|
|00004fa0| 67 69 6e 7b 65 78 61 6d | 70 6c 65 7d 0a 7b 73 6d |gin{exam|ple}.{sm|
|00004fb0| 61 6c 6c 2c 20 66 61 73 | 74 7d 20 73 65 74 2d 63 |all, fas|t} set-c|
|00004fc0| 61 72 20 28 63 6f 6e 73 | 20 6e 65 77 2d 76 61 6c |ar (cons| new-val|
|00004fd0| 75 65 29 0a 7b 73 6d 61 | 6c 6c 2c 20 66 61 73 74 |ue).{sma|ll, fast|
|00004fe0| 7d 20 73 65 74 2d 63 64 | 72 20 28 63 6f 6e 73 20 |} set-cd|r (cons |
|00004ff0| 6e 65 77 2d 76 61 6c 75 | 65 29 0a 5c 65 6e 64 7b |new-valu|e).\end{|
|00005000| 65 78 61 6d 70 6c 65 7d | 0a 0a 54 68 65 73 65 20 |example}|..These |
|00005010| 56 4f 50 73 20 69 6d 70 | 6c 65 6d 65 6e 74 20 74 |VOPs imp|lement t|
|00005020| 68 65 20 5c 63 6c 69 73 | 70 20 7b 5c 74 74 20 61 |he \clis|p {\tt a|
|00005030| 73 73 6f 63 7d 20 61 6e | 64 20 7b 5c 74 74 20 6d |ssoc} an|d {\tt m|
|00005040| 65 6d 62 65 72 7d 20 66 | 75 6e 63 74 69 6f 6e 73 |ember} f|unctions|
|00005050| 20 77 69 74 68 20 74 65 | 73 74 0a 66 75 6e 63 74 | with te|st.funct|
|00005060| 69 6f 6e 73 20 6f 66 20 | 7b 5c 74 74 20 65 71 6c |ions of |{\tt eql|
|00005070| 7d 20 61 6e 64 20 7b 5c | 74 74 20 65 71 7d 3a 0a |} and {\|tt eq}:.|
|00005080| 5c 62 65 67 69 6e 7b 65 | 78 61 6d 70 6c 65 7d 0a |\begin{e|xample}.|
|00005090| 61 73 73 6f 63 20 28 69 | 74 65 6d 20 61 6c 69 73 |assoc (i|tem alis|
|000050a0| 74 29 20 3d 3e 20 63 6f | 6e 73 2d 6f 72 2d 6e 69 |t) => co|ns-or-ni|
|000050b0| 6c 0a 61 73 73 71 20 28 | 69 74 65 6d 20 61 6c 69 |l.assq (|item ali|
|000050c0| 73 74 29 20 3d 3e 20 63 | 6f 6e 73 2d 6f 72 2d 6e |st) => c|ons-or-n|
|000050d0| 69 6c 0a 6d 65 6d 62 65 | 72 20 28 69 74 65 6d 20 |il.membe|r (item |
|000050e0| 6c 69 73 74 29 20 3d 3e | 20 63 6f 6e 73 2d 6f 72 |list) =>| cons-or|
|000050f0| 2d 6e 69 6c 0a 6d 65 6d | 71 20 28 69 74 65 6d 20 |-nil.mem|q (item |
|00005100| 6c 69 73 74 29 20 3d 3e | 20 63 6f 6e 73 2d 6f 72 |list) =>| cons-or|
|00005110| 2d 6e 69 6c 0a 5c 65 6e | 64 7b 65 78 61 6d 70 6c |-nil.\en|d{exampl|
|00005120| 65 7d 0a 0a 0a 7b 5c 74 | 74 20 67 65 74 66 7d 20 |e}...{\t|t getf} |
|00005130| 69 6d 70 6c 65 6d 65 6e | 74 73 20 74 68 65 20 63 |implemen|ts the c|
|00005140| 6f 72 72 65 73 70 6f 6e | 64 69 6e 67 20 5c 63 6c |orrespon|ding \cl|
|00005150| 69 73 70 20 66 75 6e 63 | 74 69 6f 6e 2c 20 77 68 |isp func|tion, wh|
|00005160| 69 6c 65 20 7b 5c 74 74 | 20 70 75 74 66 7d 20 69 |ile {\tt| putf} i|
|00005170| 73 20 75 73 65 64 0a 74 | 6f 20 69 6d 70 6c 65 6d |s used.t|o implem|
|00005180| 65 6e 74 20 69 74 73 20 | 73 65 74 66 2d 69 6e 76 |ent its |setf-inv|
|00005190| 65 72 73 65 2e 20 20 7b | 5c 74 74 20 70 75 74 66 |erse. {|\tt putf|
|000051a0| 7d 20 72 65 74 75 72 6e | 73 20 74 68 65 20 6e 65 |} return|s the ne|
|000051b0| 77 20 76 61 6c 75 65 20 | 66 6f 72 20 74 68 65 20 |w value |for the |
|000051c0| 6c 69 73 74 20 73 6f 0a | 74 68 61 74 20 69 74 20 |list so.|that it |
|000051d0| 6d 61 79 20 73 74 6f 72 | 65 64 20 62 61 63 6b 20 |may stor|ed back |
|000051e0| 69 6e 74 6f 20 74 68 65 | 20 70 6c 61 63 65 2e 0a |into the| place..|
|000051f0| 5c 62 65 67 69 6e 7b 65 | 78 61 6d 70 6c 65 7d 0a |\begin{e|xample}.|
|00005200| 67 65 74 66 20 28 6c 69 | 73 74 20 69 6e 64 69 63 |getf (li|st indic|
|00005210| 61 74 6f 72 20 64 65 66 | 61 75 6c 74 29 20 3d 3e |ator def|ault) =>|
|00005220| 20 76 61 6c 75 65 0a 70 | 75 74 66 20 28 6c 69 73 | value.p|utf (lis|
|00005230| 74 20 69 6e 64 69 63 61 | 74 6f 72 20 6e 65 77 2d |t indica|tor new-|
|00005240| 76 61 6c 75 65 29 20 3d | 3e 20 6c 69 73 74 0a 5c |value) =|> list.\|
|00005250| 65 6e 64 7b 65 78 61 6d | 70 6c 65 7d 0a 0a 0c 0a |end{exam|ple}....|
|00005260| 5c 63 68 61 70 74 65 72 | 7b 4e 75 6d 62 65 72 73 |\chapter|{Numbers|
|00005270| 7d 0a 0a 5c 69 6e 64 65 | 78 7b 46 69 78 6e 75 6d |}..\inde|x{Fixnum|
|00005280| 20 66 6f 72 6d 61 74 7d | 0a 46 69 78 6e 75 6d 5c | format}|.Fixnum\|
|00005290| 5c 41 6e 20 4e 2d 62 69 | 74 20 74 77 6f 27 73 20 |\An N-bi|t two's |
|000052a0| 63 6f 6d 70 6c 65 6d 65 | 6e 74 20 69 6e 74 65 67 |compleme|nt integ|
|000052b0| 65 72 2e 0a 0a 5c 69 6e | 64 65 78 7b 53 68 6f 72 |er...\in|dex{Shor|
|000052c0| 74 20 66 6c 6f 61 74 20 | 66 6f 72 6d 61 74 7d 0a |t float |format}.|
|000052d0| 53 68 6f 72 74 2d 46 6c | 6f 61 74 5c 5c 41 6e 20 |Short-Fl|oat\\An |
|000052e0| 69 6d 6d 65 64 69 61 74 | 65 20 66 6c 6f 61 74 20 |immediat|e float |
|000052f0| 66 6f 72 6d 61 74 2e 0a | 0a 5c 69 6e 64 65 78 7b |format..|.\index{|
|00005300| 42 69 67 6e 75 6d 20 66 | 6f 72 6d 61 74 7d 0a 5c |Bignum f|ormat}.\|
|00005310| 6c 61 62 65 6c 7b 42 69 | 67 6e 75 6d 73 7d 0a 42 |label{Bi|gnums}.B|
|00005320| 69 67 6e 75 6d 5c 5c 42 | 69 67 6e 75 6d 73 20 61 |ignum\\B|ignums a|
|00005330| 72 65 20 69 6e 66 69 6e | 69 74 65 2d 70 72 65 63 |re infin|ite-prec|
|00005340| 69 73 69 6f 6e 20 69 6e | 74 65 67 65 72 73 2c 20 |ision in|tegers, |
|00005350| 72 65 70 72 65 73 65 6e | 74 65 64 20 73 6f 6d 65 |represen|ted some|
|00005360| 68 6f 77 2e 0a 0a 5c 69 | 6e 64 65 78 7b 46 6c 6f |how...\i|ndex{Flo|
|00005370| 6e 75 6d 20 66 6f 72 6d | 61 74 7d 0a 5c 69 6e 64 |num form|at}.\ind|
|00005380| 65 78 7b 46 6c 6f 61 74 | 69 6e 67 20 70 6f 69 6e |ex{Float|ing poin|
|00005390| 74 20 66 6f 72 6d 61 74 | 73 7d 0a 46 6c 6f 61 74 |t format|s}.Float|
|000053a0| 73 5c 5c 46 6c 6f 61 74 | 73 20 61 72 65 20 73 74 |s\\Float|s are st|
|000053b0| 6f 72 65 64 20 61 73 20 | 63 6f 6e 73 65 63 75 74 |ored as |consecut|
|000053c0| 69 76 65 20 77 6f 72 64 | 73 20 6f 66 20 62 69 74 |ive word|s of bit|
|000053d0| 73 2e 0a 0a 5c 69 6e 64 | 65 78 7b 52 61 74 69 6f |s...\ind|ex{Ratio|
|000053e0| 20 66 6f 72 6d 61 74 7d | 0a 52 61 74 69 6f 5c 5c | format}|.Ratio\\|
|000053f0| 52 61 74 69 6f 73 20 61 | 72 65 20 73 74 6f 72 65 |Ratios a|re store|
|00005400| 64 20 61 73 20 74 77 6f | 20 63 6f 6e 73 65 63 75 |d as two| consecu|
|00005410| 74 69 76 65 20 77 6f 72 | 64 73 20 6f 66 20 4c 69 |tive wor|ds of Li|
|00005420| 73 70 20 6f 62 6a 65 63 | 74 73 2c 20 77 68 69 63 |sp objec|ts, whic|
|00005430| 68 20 73 68 6f 75 6c 64 | 0a 62 6f 74 68 20 62 65 |h should|.both be|
|00005440| 20 69 6e 74 65 67 65 72 | 73 2e 0a 0a 5c 69 6e 64 | integer|s...\ind|
|00005450| 65 78 7b 43 6f 6d 70 6c | 65 78 20 6e 75 6d 62 65 |ex{Compl|ex numbe|
|00005460| 72 20 66 6f 72 6d 61 74 | 7d 0a 43 6f 6d 70 6c 65 |r format|}.Comple|
|00005470| 78 5c 5c 43 6f 6d 70 6c | 65 78 20 6e 75 6d 62 65 |x\\Compl|ex numbe|
|00005480| 72 73 20 61 72 65 20 73 | 74 6f 72 65 64 20 61 73 |rs are s|tored as|
|00005490| 20 74 77 6f 20 63 6f 6e | 73 65 63 75 74 69 76 65 | two con|secutive|
|000054a0| 20 77 6f 72 64 73 20 6f | 66 20 4c 69 73 70 20 6f | words o|f Lisp o|
|000054b0| 62 6a 65 63 74 73 2c 0a | 77 68 69 63 68 20 73 68 |bjects,.|which sh|
|000054c0| 6f 75 6c 64 20 62 6f 74 | 68 20 62 65 20 6e 75 6d |ould bot|h be num|
|000054d0| 62 65 72 73 2e 0a 0a 0a | 0c 0a 5c 73 65 63 74 69 |bers....|..\secti|
|000054e0| 6f 6e 7b 4e 75 6d 62 65 | 72 20 56 4f 50 73 7d 0a |on{Numbe|r VOPs}.|
|000054f0| 0a 69 6e 74 65 67 65 72 | 2d 6c 65 6e 67 74 68 0a |.integer|-length.|
|00005500| 7b 73 6d 61 6c 6c 2c 20 | 66 61 73 74 7d 20 69 6e |{small, |fast} in|
|00005510| 74 65 67 65 72 2d 6c 65 | 6e 67 74 68 2f 66 69 78 |teger-le|ngth/fix|
|00005520| 6e 75 6d 0a 0a 66 6c 6f | 61 74 3d 3e 78 78 78 2d |num..flo|at=>xxx-|
|00005530| 66 6c 6f 61 74 0a 0a 72 | 65 61 6c 70 61 72 74 0a |float..r|ealpart.|
|00005540| 6c 6d 61 67 70 61 72 74 | 0a 6e 75 6d 65 72 61 74 |lmagpart|.numerat|
|00005550| 6f 72 0a 64 65 6e 6f 6d | 69 6e 61 74 6f 72 0a 64 |or.denom|inator.d|
|00005560| 65 63 6f 64 65 2d 66 6c | 6f 61 74 0a 7b 73 6d 61 |ecode-fl|oat.{sma|
|00005570| 6c 6c 2c 20 66 61 73 74 | 7d 20 64 65 63 6f 64 65 |ll, fast|} decode|
|00005580| 2d 66 6c 6f 61 74 2f 78 | 78 78 2d 66 6c 6f 61 74 |-float/x|xx-float|
|00005590| 0a 73 63 61 6c 65 2d 66 | 6c 6f 61 74 0a 7b 73 6d |.scale-f|loat.{sm|
|000055a0| 61 6c 6c 2c 20 66 61 73 | 74 7d 20 73 63 61 6c 65 |all, fas|t} scale|
|000055b0| 2d 66 6c 6f 61 74 2f 78 | 78 78 2d 66 6c 6f 61 74 |-float/x|xx-float|
|000055c0| 0a 0a 69 66 2d 3d 20 28 | 78 20 79 29 0a 7b 73 6d |..if-= (|x y).{sm|
|000055d0| 61 6c 6c 2c 20 66 61 73 | 74 7d 20 69 66 2d 3d 2f |all, fas|t} if-=/|
|000055e0| 66 69 78 6e 75 6d 0a 7b | 73 6d 61 6c 6c 2c 20 66 |fixnum.{|small, f|
|000055f0| 61 73 74 7d 20 69 66 2d | 3d 2f 78 78 78 2d 66 6c |ast} if-|=/xxx-fl|
|00005600| 6f 61 74 0a 20 20 20 20 | 44 6f 20 6e 75 6d 65 72 |oat. |Do numer|
|00005610| 69 63 20 63 6f 6d 70 61 | 72 69 73 6f 6e 20 6f 66 |ic compa|rison of|
|00005620| 20 58 20 61 6e 64 20 59 | 2e 20 20 54 68 65 20 63 | X and Y|. The c|
|00005630| 6f 64 65 67 65 6e 2d 69 | 6e 66 6f 20 63 6f 6e 74 |odegen-i|nfo cont|
|00005640| 61 69 6e 73 20 74 68 65 | 0a 20 20 20 20 63 6f 6e |ains the|. con|
|00005650| 74 69 6e 75 61 74 69 6f | 6e 73 20 74 6f 20 74 72 |tinuatio|ns to tr|
|00005660| 61 6e 73 66 65 72 20 74 | 6f 20 69 6e 20 74 68 65 |ansfer t|o in the|
|00005670| 20 74 72 75 65 20 61 6e | 64 20 66 61 6c 73 65 20 | true an|d false |
|00005680| 63 61 73 65 73 2e 20 20 | 53 61 6d 65 20 66 6f 72 |cases. |Same for|
|00005690| 20 3c 2c 20 3e 2e 0a 0a | 2b 20 28 78 20 79 29 20 | <, >...|+ (x y) |
|000056a0| 3d 3e 20 7a 0a 7b 73 6d | 61 6c 6c 2c 20 66 61 73 |=> z.{sm|all, fas|
|000056b0| 74 7d 20 2b 2f 66 69 78 | 6e 75 6d 0a 7b 73 6d 61 |t} +/fix|num.{sma|
|000056c0| 6c 6c 2c 20 66 61 73 74 | 7d 20 2b 2f 66 69 78 6e |ll, fast|} +/fixn|
|000056d0| 75 6d 3d 3e 69 6e 74 65 | 67 65 72 0a 7b 73 6d 61 |um=>inte|ger.{sma|
|000056e0| 6c 6c 2c 20 66 61 73 74 | 7d 20 2b 2f 78 78 78 2d |ll, fast|} +/xxx-|
|000056f0| 66 6c 6f 61 74 0a 20 20 | 20 20 53 61 6d 65 20 66 |float. | Same f|
|00005700| 6f 72 20 2d 2c 20 2a 2e | 20 20 20 46 69 78 6e 75 |or -, *.| Fixnu|
|00005710| 6d 20 6d 75 6c 74 69 70 | 6c 69 63 61 74 69 6f 6e |m multip|lication|
|00005720| 20 62 79 20 61 20 63 6f | 6e 73 74 61 6e 74 20 70 | by a co|nstant p|
|00005730| 6f 77 65 72 20 6f 66 20 | 32 20 28 6f 72 20 6e 65 |ower of |2 (or ne|
|00005740| 61 72 0a 20 20 20 20 70 | 6f 77 65 72 20 6f 66 20 |ar. p|ower of |
|00005750| 32 29 20 63 61 6e 20 62 | 65 20 64 6f 6e 65 20 62 |2) can b|e done b|
|00005760| 79 20 61 20 74 72 61 6e | 73 66 6f 72 6d 2e 0a 0a |y a tran|sform...|
|00005770| 2f 20 28 78 20 79 29 20 | 3d 3e 20 7a 0a 7b 73 6d |/ (x y) |=> z.{sm|
|00005780| 61 6c 6c 2c 20 66 61 73 | 74 7d 20 2f 2f 78 78 78 |all, fas|t} //xxx|
|00005790| 2d 66 6c 6f 61 74 0a 0a | 6e 65 67 61 74 65 0a 7b |-float..|negate.{|
|000057a0| 73 6d 61 6c 6c 2c 20 66 | 61 73 74 7d 20 6e 65 67 |small, f|ast} neg|
|000057b0| 61 74 65 2f 66 69 78 6e | 75 6d 0a 7b 73 6d 61 6c |ate/fixn|um.{smal|
|000057c0| 6c 2c 20 66 61 73 74 7d | 20 6e 65 67 61 74 65 2f |l, fast}| negate/|
|000057d0| 66 69 78 6e 75 6d 3d 3e | 69 6e 74 65 67 65 72 0a |fixnum=>|integer.|
|000057e0| 7b 73 6d 61 6c 6c 2c 20 | 66 61 73 74 7d 20 6e 65 |{small, |fast} ne|
|000057f0| 67 61 74 65 2f 78 78 78 | 2d 66 6c 6f 61 74 0a 20 |gate/xxx|-float. |
|00005800| 20 20 20 44 69 74 74 6f | 20 66 6f 72 20 41 62 73 | Ditto| for Abs|
|00005810| 2e 0a 0a 74 72 75 6e 63 | 61 74 65 20 28 78 20 79 |...trunc|ate (x y|
|00005820| 29 20 3d 3e 20 71 20 72 | 0a 7b 73 6d 61 6c 6c 2c |) => q r|.{small,|
|00005830| 20 66 61 73 74 7d 20 74 | 72 75 6e 63 61 74 65 2f | fast} t|runcate/|
|00005840| 66 69 78 6e 75 6d 0a 0a | 6c 6f 67 61 6e 64 20 28 |fixnum..|logand (|
|00005850| 78 20 79 29 20 3d 3e 20 | 7a 0a 7b 73 6d 61 6c 6c |x y) => |z.{small|
|00005860| 2c 20 66 61 73 74 7d 20 | 6c 6f 67 61 6e 64 2f 66 |, fast} |logand/f|
|00005870| 69 78 6e 75 6d 0a 20 20 | 20 20 44 69 74 74 6f 20 |ixnum. | Ditto |
|00005880| 66 6f 72 20 6c 6f 67 69 | 6f 72 2c 20 6c 6f 67 78 |for logi|or, logx|
|00005890| 6f 72 2e 0a 20 20 20 20 | 0a 6c 6f 67 6e 6f 74 20 |or.. |.lognot |
|000058a0| 28 6e 29 20 3d 3e 20 7a | 0a 7b 73 6d 61 6c 6c 2c |(n) => z|.{small,|
|000058b0| 20 66 61 73 74 7d 20 6c | 6f 67 6e 6f 74 2f 66 69 | fast} l|ognot/fi|
|000058c0| 78 6e 75 6d 0a 0a 61 73 | 68 20 28 6e 20 78 29 20 |xnum..as|h (n x) |
|000058d0| 3d 3e 20 7a 0a 7b 73 6d | 61 6c 6c 2c 20 66 61 73 |=> z.{sm|all, fas|
|000058e0| 74 7d 20 61 73 68 2f 66 | 69 78 6e 75 6d 0a 7b 73 |t} ash/f|ixnum.{s|
|000058f0| 6d 61 6c 6c 2c 20 66 61 | 73 74 7d 20 61 73 68 2d |mall, fa|st} ash-|
|00005900| 63 2f 66 69 78 6e 75 6d | 0a 0a 6c 64 62 0a 64 70 |c/fixnum|..ldb.dp|
|00005910| 62 0a 6d 61 73 6b 2d 66 | 69 65 6c 64 0a 64 65 70 |b.mask-f|ield.dep|
|00005920| 6f 73 69 74 2d 66 69 65 | 6c 64 0a 20 20 20 20 54 |osit-fie|ld. T|
|00005930| 68 65 73 65 20 77 69 6c | 6c 20 6f 6e 6c 79 20 62 |hese wil|l only b|
|00005940| 65 20 75 73 65 64 20 61 | 73 20 61 20 6c 61 73 74 |e used a|s a last|
|00005950| 20 72 65 73 6f 72 74 2e | 20 20 54 68 65 72 65 20 | resort.| There |
|00005960| 73 68 6f 75 6c 64 20 62 | 65 20 74 72 61 6e 73 66 |should b|e transf|
|00005970| 6f 72 6d 73 20 74 68 61 | 74 0a 20 20 20 20 74 75 |orms tha|t. tu|
|00005980| 72 6e 20 66 69 78 6e 75 | 6d 20 6f 70 65 72 61 74 |rn fixnu|m operat|
|00005990| 69 6f 6e 73 20 77 69 74 | 68 20 63 6f 6e 73 74 61 |ions wit|h consta|
|000059a0| 6e 74 20 62 79 74 65 2d | 73 70 65 63 69 66 69 65 |nt byte-|specifie|
|000059b0| 72 73 20 69 6e 74 6f 20 | 73 74 61 6e 64 61 72 64 |rs into |standard|
|000059c0| 20 6c 6f 67 69 63 61 6c | 0a 20 20 20 20 6f 70 65 | logical|. ope|
|000059d0| 72 61 74 69 6f 6e 73 2e | 0a 0a 0c 0a 5c 73 65 63 |rations.|....\sec|
|000059e0| 74 69 6f 6e 7b 4e 75 6d | 62 65 72 20 53 75 62 2d |tion{Num|ber Sub-|
|000059f0| 70 72 69 6d 69 74 69 76 | 65 73 7d 0a 0a 0a 61 6c |primitiv|es}...al|
|00005a00| 6c 6f 63 2d 62 69 67 6e | 75 6d 0a 6d 61 6b 65 2d |loc-bign|um.make-|
|00005a10| 63 6f 6d 70 6c 65 78 0a | 6d 61 6b 65 2d 72 61 74 |complex.|make-rat|
|00005a20| 69 6f 0a 6c 73 68 0a 6c | 6f 67 6c 64 62 0a 6c 6f |io.lsh.l|ogldb.lo|
|00005a30| 67 64 70 62 0a 0a 0a 0c | 0a 5c 63 68 61 70 74 65 |gdpb....|.\chapte|
|00005a40| 72 7b 41 72 72 61 79 73 | 7d 0a 0a 5c 63 6c 20 61 |r{Arrays|}..\cl a|
|00005a50| 72 72 61 79 73 20 63 61 | 6e 20 62 65 20 72 65 70 |rrays ca|n be rep|
|00005a60| 72 65 73 65 6e 74 65 64 | 20 69 6e 20 61 20 66 65 |resented| in a fe|
|00005a70| 77 20 64 69 66 66 65 72 | 65 6e 74 20 77 61 79 73 |w differ|ent ways|
|00005a80| 20 69 6e 20 5c 72 74 63 | 63 6c 20 2d 2d 0a 64 69 | in \rtc|cl --.di|
|00005a90| 66 66 65 72 65 6e 74 20 | 72 65 70 72 65 73 65 6e |fferent |represen|
|00005aa0| 74 61 74 69 6f 6e 73 20 | 68 61 76 65 20 64 69 66 |tations |have dif|
|00005ab0| 66 65 72 65 6e 74 20 70 | 65 72 66 6f 72 6d 61 6e |ferent p|erforman|
|00005ac0| 63 65 20 61 64 76 61 6e | 74 61 67 65 73 2e 20 20 |ce advan|tages. |
|00005ad0| 53 69 6d 70 6c 65 0a 67 | 65 6e 65 72 61 6c 20 76 |Simple.g|eneral v|
|00005ae0| 65 63 74 6f 72 73 2c 20 | 73 69 6d 70 6c 65 20 76 |ectors, |simple v|
|00005af0| 65 63 74 6f 72 73 20 6f | 66 20 69 6e 74 65 67 65 |ectors o|f intege|
|00005b00| 72 73 2c 20 61 6e 64 20 | 73 69 6d 70 6c 65 20 73 |rs, and |simple s|
|00005b10| 74 72 69 6e 67 73 20 61 | 72 65 20 62 61 73 69 63 |trings a|re basic|
|00005b20| 20 5c 72 74 63 63 6c 0a | 20 64 61 74 61 20 74 79 | \rtccl.| data ty|
|00005b30| 70 65 73 2c 20 61 6e 64 | 20 61 63 63 65 73 73 20 |pes, and| access |
|00005b40| 74 6f 20 74 68 65 73 65 | 20 73 74 72 75 63 74 75 |to these| structu|
|00005b50| 72 65 73 20 69 73 20 71 | 75 69 63 6b 65 72 20 74 |res is q|uicker t|
|00005b60| 68 61 6e 20 61 63 63 65 | 73 73 20 74 6f 0a 6e 6f |han acce|ss to.no|
|00005b70| 6e 2d 73 69 6d 70 6c 65 | 20 28 6f 72 20 60 60 63 |n-simple| (or ``c|
|00005b80| 6f 6d 70 6c 65 78 27 27 | 29 20 61 72 72 61 79 73 |omplex''|) arrays|
|00005b90| 2e 20 20 48 6f 77 65 76 | 65 72 2c 20 61 6c 6c 20 |. Howev|er, all |
|00005ba0| 6d 75 6c 74 69 2d 64 69 | 6d 65 6e 73 69 6f 6e 61 |multi-di|mensiona|
|00005bb0| 6c 20 61 72 72 61 79 73 | 20 69 6e 0a 5c 72 74 63 |l arrays| in.\rtc|
|00005bc0| 63 6c 20 61 72 65 20 63 | 6f 6d 70 6c 65 78 20 61 |cl are c|omplex a|
|00005bd0| 72 72 61 79 73 2c 20 73 | 6f 20 72 65 66 65 72 65 |rrays, s|o refere|
|00005be0| 6e 63 65 73 20 74 6f 20 | 74 68 65 73 65 20 61 72 |nces to |these ar|
|00005bf0| 65 20 61 6c 77 61 79 73 | 20 74 68 72 6f 75 67 68 |e always| through|
|00005c00| 20 61 0a 68 65 61 64 65 | 72 20 73 74 72 75 63 74 | a.heade|r struct|
|00005c10| 75 72 65 2e 0a 0a 0a 4f | 6e 63 65 20 61 20 76 65 |ure....O|nce a ve|
|00005c20| 63 74 6f 72 20 68 61 73 | 20 62 65 65 6e 20 61 6c |ctor has| been al|
|00005c30| 6c 6f 63 61 74 65 64 2c | 20 69 74 20 69 73 20 70 |located,| it is p|
|00005c40| 6f 73 73 69 62 6c 65 20 | 74 6f 20 72 65 64 75 63 |ossible |to reduc|
|00005c50| 65 20 69 74 73 20 6c 65 | 6e 67 74 68 20 62 79 20 |e its le|ngth by |
|00005c60| 75 73 69 6e 67 0a 74 68 | 65 20 53 68 72 69 6e 6b |using.th|e Shrink|
|00005c70| 2d 56 65 63 74 6f 72 20 | 73 75 62 2d 70 72 69 6d |-Vector |sub-prim|
|00005c80| 69 74 69 76 65 2c 20 62 | 75 74 20 6e 65 76 65 72 |itive, b|ut never|
|00005c90| 20 74 6f 20 69 6e 63 72 | 65 61 73 65 20 69 74 73 | to incr|ease its|
|00005ca0| 20 6c 65 6e 67 74 68 2c | 20 65 76 65 6e 20 62 61 | length,| even ba|
|00005cb0| 63 6b 20 74 6f 0a 74 68 | 65 20 6f 72 69 67 69 6e |ck to.th|e origin|
|00005cc0| 61 6c 20 73 69 7a 65 2c | 20 73 69 6e 63 65 20 74 |al size,| since t|
|00005cd0| 68 65 20 73 70 61 63 65 | 20 66 72 65 65 64 20 62 |he space| freed b|
|00005ce0| 79 20 74 68 65 20 72 65 | 64 75 63 74 69 6f 6e 20 |y the re|duction |
|00005cf0| 6d 61 79 20 68 61 76 65 | 20 62 65 65 6e 0a 72 65 |may have| been.re|
|00005d00| 63 6c 61 69 6d 65 64 2e | 0a 0a 0a 0c 0a 5c 73 75 |claimed.|.....\su|
|00005d10| 62 73 65 63 74 69 6f 6e | 7b 41 72 72 61 79 73 7d |bsection|{Arrays}|
|00005d20| 0a 5c 6c 61 62 65 6c 7b | 41 72 72 61 79 73 7d 0a |.\label{|Arrays}.|
|00005d30| 5c 69 6e 64 65 78 7b 41 | 72 72 61 79 73 7d 0a 0a |\index{A|rrays}..|
|00005d40| 41 6e 20 61 72 72 61 79 | 20 68 65 61 64 65 72 20 |An array| header |
|00005d50| 69 73 20 69 64 65 6e 74 | 69 63 61 6c 20 69 6e 20 |is ident|ical in |
|00005d60| 66 6f 72 6d 20 74 6f 20 | 61 20 47 2d 56 65 63 74 |form to |a G-Vect|
|00005d70| 6f 72 2e 20 20 41 74 20 | 70 72 65 73 65 6e 74 2c |or. At |present,|
|00005d80| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 0a 73 | the fol|lowing.s|
|00005d90| 75 62 74 79 70 65 20 63 | 6f 64 65 73 20 61 72 65 |ubtype c|odes are|
|00005da0| 20 64 65 66 69 6e 65 64 | 3a 0a 5c 62 65 67 69 6e | defined|:.\begin|
|00005db0| 7b 69 74 65 6d 69 7a 65 | 2c 20 73 70 72 65 61 64 |{itemize|, spread|
|00005dc0| 20 30 2c 20 73 70 61 63 | 69 6e 67 20 31 7d 0a 30 | 0, spac|ing 1}.0|
|00005dd0| 20 4e 6f 72 6d 61 6c 2e | 0a 31 20 41 72 72 61 79 | Normal.|.1 Array|
|00005de0| 20 69 73 20 64 69 73 70 | 6c 61 63 65 64 20 74 6f | is disp|laced to|
|00005df0| 20 61 6e 6f 74 68 65 72 | 20 61 72 72 61 79 20 28 | another| array (|
|00005e00| 77 68 69 63 68 20 6d 61 | 79 20 62 65 20 73 69 6d |which ma|y be sim|
|00005e10| 70 6c 65 29 2e 0a 5c 65 | 6e 64 7b 69 74 65 6d 69 |ple)..\e|nd{itemi|
|00005e20| 7a 65 7d 0a 54 68 65 20 | 65 6e 74 72 69 65 73 20 |ze}.The |entries |
|00005e30| 69 6e 20 74 68 65 20 68 | 65 61 64 65 72 2d 76 65 |in the h|eader-ve|
|00005e40| 63 74 6f 72 20 61 72 65 | 20 69 6e 74 65 72 70 72 |ctor are| interpr|
|00005e50| 65 74 65 64 20 61 73 20 | 66 6f 6c 6c 6f 77 73 3a |eted as |follows:|
|00005e60| 0a 0a 5c 69 6e 64 65 78 | 7b 41 72 72 61 79 20 68 |..\index|{Array h|
|00005e70| 65 61 64 65 72 20 66 6f | 72 6d 61 74 7d 0a 5c 62 |eader fo|rmat}.\b|
|00005e80| 65 67 69 6e 7b 64 65 73 | 63 72 69 70 74 69 6f 6e |egin{des|cription|
|00005e90| 7d 0a 30 20 44 61 74 61 | 20 56 65 63 74 6f 72 20 |}.0 Data| Vector |
|00005ea0| 5c 5c 54 68 69 73 20 69 | 73 20 61 20 70 6f 69 6e |\\This i|s a poin|
|00005eb0| 74 65 72 20 74 6f 20 74 | 68 65 20 49 2d 56 65 63 |ter to t|he I-Vec|
|00005ec0| 74 6f 72 2c 20 47 2d 56 | 65 63 74 6f 72 2c 20 6f |tor, G-V|ector, o|
|00005ed0| 72 20 73 74 72 69 6e 67 | 20 74 68 61 74 0a 63 6f |r string| that.co|
|00005ee0| 6e 74 61 69 6e 73 20 74 | 68 65 20 61 63 74 75 61 |ntains t|he actua|
|00005ef0| 6c 20 64 61 74 61 20 6f | 66 20 74 68 65 20 61 72 |l data o|f the ar|
|00005f00| 72 61 79 2e 09 49 6e 20 | 61 20 6d 75 6c 74 69 2d |ray..In |a multi-|
|00005f10| 64 69 6d 65 6e 73 69 6f | 6e 61 6c 20 61 72 72 61 |dimensio|nal arra|
|00005f20| 79 2c 20 74 68 65 0a 73 | 75 70 70 6c 69 65 64 20 |y, the.s|upplied |
|00005f30| 69 6e 64 69 63 65 73 20 | 61 72 65 20 63 6f 6e 76 |indices |are conv|
|00005f40| 65 72 74 65 64 20 69 6e | 74 6f 20 61 20 73 69 6e |erted in|to a sin|
|00005f50| 67 6c 65 20 31 2d 44 20 | 69 6e 64 65 78 20 77 68 |gle 1-D |index wh|
|00005f60| 69 63 68 20 69 73 20 75 | 73 65 64 20 74 6f 20 61 |ich is u|sed to a|
|00005f70| 63 63 65 73 73 0a 74 68 | 65 20 64 61 74 61 20 76 |ccess.th|e data v|
|00005f80| 65 63 74 6f 72 20 69 6e | 20 74 68 65 20 75 73 75 |ector in| the usu|
|00005f90| 61 6c 20 77 61 79 2e 20 | 20 49 66 20 74 68 65 20 |al way. | If the |
|00005fa0| 61 72 72 61 79 20 69 73 | 20 64 69 73 70 6c 61 63 |array is| displac|
|00005fb0| 65 64 2c 20 74 68 65 6e | 20 74 68 69 73 20 69 73 |ed, then| this is|
|00005fc0| 0a 74 68 65 20 61 72 72 | 61 79 20 64 69 73 70 6c |.the arr|ay displ|
|00005fd0| 61 63 65 64 20 74 6f 2c | 20 77 68 69 63 68 20 6d |aced to,| which m|
|00005fe0| 61 79 20 62 65 20 61 6e | 20 61 72 72 61 79 20 68 |ay be an| array h|
|00005ff0| 65 61 64 65 72 2e 20 20 | 49 6e 20 67 65 6e 65 72 |eader. |In gener|
|00006000| 61 6c 2c 20 61 72 72 61 | 79 0a 61 63 63 65 73 73 |al, arra|y.access|
|00006010| 20 6d 75 73 74 20 6c 6f | 6f 70 20 75 6e 74 69 6c | must lo|op until|
|00006020| 20 69 74 20 66 69 6e 64 | 73 20 61 6e 20 61 63 74 | it find|s an act|
|00006030| 75 61 6c 20 64 61 74 61 | 20 76 65 63 74 6f 72 2e |ual data| vector.|
|00006040| 0a 0a 31 20 4e 75 6d 62 | 65 72 20 6f 66 20 45 6c |..1 Numb|er of El|
|00006050| 65 6d 65 6e 74 73 20 5c | 5c 54 68 69 73 20 69 73 |ements \|\This is|
|00006060| 20 61 20 66 69 78 6e 75 | 6d 20 69 6e 64 69 63 61 | a fixnu|m indica|
|00006070| 74 69 6e 67 20 74 68 65 | 20 6e 75 6d 62 65 72 20 |ting the| number |
|00006080| 6f 66 20 65 6c 65 6d 65 | 6e 74 73 20 66 6f 72 0a |of eleme|nts for.|
|00006090| 77 68 69 63 68 20 74 68 | 65 72 65 20 69 73 20 73 |which th|ere is s|
|000060a0| 70 61 63 65 20 69 6e 20 | 74 68 65 20 64 61 74 61 |pace in |the data|
|000060b0| 20 76 65 63 74 6f 72 2e | 0a 0a 32 20 46 69 6c 6c | vector.|..2 Fill|
|000060c0| 20 50 6f 69 6e 74 65 72 | 20 5c 5c 54 68 69 73 20 | Pointer| \\This |
|000060d0| 69 73 20 61 20 66 69 78 | 6e 75 6d 20 69 6e 64 69 |is a fix|num indi|
|000060e0| 63 61 74 69 6e 67 20 68 | 6f 77 20 6d 61 6e 79 20 |cating h|ow many |
|000060f0| 65 6c 65 6d 65 6e 74 73 | 20 6f 66 20 74 68 65 20 |elements| of the |
|00006100| 64 61 74 61 0a 76 65 63 | 74 6f 72 20 61 72 65 20 |data.vec|tor are |
|00006110| 61 63 74 75 61 6c 6c 79 | 20 63 6f 6e 73 69 64 65 |actually| conside|
|00006120| 72 65 64 20 74 6f 20 62 | 65 20 69 6e 20 75 73 65 |red to b|e in use|
|00006130| 2e 20 20 4e 6f 72 6d 61 | 6c 6c 79 20 74 68 69 73 |. Norma|lly this|
|00006140| 20 69 73 20 69 6e 69 74 | 69 61 6c 69 7a 65 64 20 | is init|ialized |
|00006150| 74 6f 0a 74 68 65 20 73 | 61 6d 65 20 76 61 6c 75 |to.the s|ame valu|
|00006160| 65 20 61 73 20 74 68 65 | 20 4e 75 6d 62 65 72 20 |e as the| Number |
|00006170| 6f 66 20 45 6c 65 6d 65 | 6e 74 73 20 66 69 65 6c |of Eleme|nts fiel|
|00006180| 64 2c 20 62 75 74 20 69 | 6e 20 73 6f 6d 65 20 61 |d, but i|n some a|
|00006190| 72 72 61 79 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |rray app|lication|
|000061a0| 73 0a 69 74 20 77 69 6c | 6c 20 62 65 20 67 69 76 |s.it wil|l be giv|
|000061b0| 65 6e 20 61 20 73 6d 61 | 6c 6c 65 72 20 76 61 6c |en a sma|ller val|
|000061c0| 75 65 2e 20 20 41 6e 79 | 20 61 63 63 65 73 73 20 |ue. Any| access |
|000061d0| 62 65 79 6f 6e 64 20 74 | 68 65 20 66 69 6c 6c 20 |beyond t|he fill |
|000061e0| 70 6f 69 6e 74 65 72 20 | 69 73 0a 69 6c 6c 65 67 |pointer |is.illeg|
|000061f0| 61 6c 2e 0a 0a 33 20 44 | 69 73 70 6c 61 63 65 6d |al...3 D|isplacem|
|00006200| 65 6e 74 20 5c 5c 54 68 | 69 73 20 66 69 78 6e 75 |ent \\Th|is fixnu|
|00006210| 6d 20 76 61 6c 75 65 20 | 69 73 20 61 64 64 65 64 |m value |is added|
|00006220| 20 74 6f 20 74 68 65 20 | 66 69 6e 61 6c 20 63 6f | to the |final co|
|00006230| 64 65 2d 76 65 63 74 6f | 72 20 69 6e 64 65 78 0a |de-vecto|r index.|
|00006240| 61 66 74 65 72 20 74 68 | 65 20 69 6e 64 65 78 20 |after th|e index |
|00006250| 61 72 69 74 68 6d 65 74 | 69 63 20 69 73 20 64 6f |arithmet|ic is do|
|00006260| 6e 65 20 62 75 74 20 62 | 65 66 6f 72 65 20 74 68 |ne but b|efore th|
|00006270| 65 20 61 63 63 65 73 73 | 20 6f 63 63 75 72 73 2e |e access| occurs.|
|00006280| 20 20 55 73 65 64 20 66 | 6f 72 0a 6d 61 70 70 69 | Used f|or.mappi|
|00006290| 6e 67 20 61 20 70 6f 72 | 74 69 6f 6e 20 6f 66 20 |ng a por|tion of |
|000062a0| 6f 6e 65 20 61 72 72 61 | 79 20 69 6e 74 6f 20 61 |one arra|y into a|
|000062b0| 6e 6f 74 68 65 72 2e 20 | 20 46 6f 72 20 6d 6f 73 |nother. | For mos|
|000062c0| 74 20 61 72 72 61 79 73 | 2c 20 74 68 69 73 20 69 |t arrays|, this i|
|000062d0| 73 20 30 2e 0a 0a 34 20 | 52 61 6e 67 65 20 6f 66 |s 0...4 |Range of|
|000062e0| 20 46 69 72 73 74 20 49 | 6e 64 65 78 20 5c 5c 54 | First I|ndex \\T|
|000062f0| 68 69 73 20 69 73 20 74 | 68 65 20 6e 75 6d 62 65 |his is t|he numbe|
|00006300| 72 20 6f 66 20 69 6e 64 | 65 78 20 76 61 6c 75 65 |r of ind|ex value|
|00006310| 73 20 61 6c 6f 6e 67 20 | 74 68 65 20 66 69 72 73 |s along |the firs|
|00006320| 74 0a 64 69 6d 65 6e 73 | 69 6f 6e 2c 20 6f 72 20 |t.dimens|ion, or |
|00006330| 6f 6e 65 20 67 72 65 61 | 74 65 72 20 74 68 61 6e |one grea|ter than|
|00006340| 20 74 68 65 20 6c 61 72 | 67 65 73 74 20 6c 65 67 | the lar|gest leg|
|00006350| 61 6c 20 76 61 6c 75 65 | 20 6f 66 20 74 68 69 73 |al value| of this|
|00006360| 20 69 6e 64 65 78 20 28 | 73 69 6e 63 65 20 74 68 | index (|since th|
|00006370| 65 0a 61 72 72 61 79 73 | 20 61 72 65 20 61 6c 77 |e.arrays| are alw|
|00006380| 61 79 73 20 7a 65 72 6f | 2d 62 61 73 65 64 29 2e |ays zero|-based).|
|00006390| 09 41 20 66 69 78 6e 75 | 6d 20 69 6e 20 74 68 65 |.A fixnu|m in the|
|000063a0| 20 72 61 6e 67 65 20 30 | 20 74 6f 20 32 5c 2b 7b | range 0| to 2\+{|
|000063b0| 32 34 7d 2d 31 2e 20 20 | 49 66 20 61 6e 79 0a 6f |24}-1. |If any.o|
|000063c0| 66 20 74 68 65 20 69 6e | 64 69 63 65 73 20 68 61 |f the in|dices ha|
|000063d0| 73 20 61 20 72 61 6e 67 | 65 20 6f 66 20 30 2c 20 |s a rang|e of 0, |
|000063e0| 74 68 65 20 61 72 72 61 | 79 20 69 73 20 6c 65 67 |the arra|y is leg|
|000063f0| 61 6c 20 62 75 74 20 77 | 69 6c 6c 20 63 6f 6e 74 |al but w|ill cont|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.