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
| LaTeX document, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| 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| 25 20 31 2e 20 53 74 72 | 75 63 74 75 72 65 20 6f |% 1. Str|ucture o|
|00000010| 66 20 74 68 65 20 6c 61 | 6e 67 75 61 67 65 0a 0a |f the la|nguage..|
|00000020| 5c 63 68 61 70 74 65 72 | 7b 4f 76 65 72 76 69 65 |\chapter|{Overvie|
|00000030| 77 20 6f 66 20 53 63 68 | 65 6d 65 7d 0a 0a 5c 73 |w of Sch|eme}..\s|
|00000040| 65 63 74 69 6f 6e 7b 53 | 65 6d 61 6e 74 69 63 73 |ection{S|emantics|
|00000050| 7d 0a 5c 6c 61 62 65 6c | 7b 73 65 6d 61 6e 74 69 |}.\label|{semanti|
|00000060| 63 73 65 63 74 69 6f 6e | 7d 0a 0a 54 68 69 73 20 |csection|}..This |
|00000070| 73 65 63 74 69 6f 6e 20 | 67 69 76 65 73 20 61 6e |section |gives an|
|00000080| 20 6f 76 65 72 76 69 65 | 77 20 6f 66 20 53 63 68 | overvie|w of Sch|
|00000090| 65 6d 65 27 73 20 73 65 | 6d 61 6e 74 69 63 73 2e |eme's se|mantics.|
|000000a0| 20 20 41 0a 64 65 74 61 | 69 6c 65 64 20 69 6e 66 | A.deta|iled inf|
|000000b0| 6f 72 6d 61 6c 20 73 65 | 6d 61 6e 74 69 63 73 20 |ormal se|mantics |
|000000c0| 69 73 20 74 68 65 20 73 | 75 62 6a 65 63 74 20 6f |is the s|ubject o|
|000000d0| 66 0a 63 68 61 70 74 65 | 72 73 7e 5c 72 65 66 7b |f.chapte|rs~\ref{|
|000000e0| 62 61 73 69 63 63 68 61 | 70 74 65 72 7d 20 74 68 |basiccha|pter} th|
|000000f0| 72 6f 75 67 68 7e 5c 72 | 65 66 7b 62 75 69 6c 74 |rough~\r|ef{built|
|00000100| 69 6e 63 68 61 70 74 65 | 72 7d 2e 20 20 46 6f 72 |inchapte|r}. For|
|00000110| 20 72 65 66 65 72 65 6e | 63 65 0a 70 75 72 70 6f | referen|ce.purpo|
|00000120| 73 65 73 2c 20 73 65 63 | 74 69 6f 6e 7e 5c 72 65 |ses, sec|tion~\re|
|00000130| 66 7b 66 6f 72 6d 61 6c | 73 65 6d 61 6e 74 69 63 |f{formal|semantic|
|00000140| 73 73 65 63 74 69 6f 6e | 7d 20 70 72 6f 76 69 64 |ssection|} provid|
|00000150| 65 73 20 61 20 66 6f 72 | 6d 61 6c 0a 73 65 6d 61 |es a for|mal.sema|
|00000160| 6e 74 69 63 73 20 6f 66 | 20 53 63 68 65 6d 65 2e |ntics of| Scheme.|
|00000170| 0a 0a 5c 76 65 73 74 20 | 46 6f 6c 6c 6f 77 69 6e |..\vest |Followin|
|00000180| 67 20 41 6c 67 6f 6c 2c | 20 53 63 68 65 6d 65 20 |g Algol,| Scheme |
|00000190| 69 73 20 61 20 73 74 61 | 74 69 63 61 6c 6c 79 20 |is a sta|tically |
|000001a0| 73 63 6f 70 65 64 20 70 | 72 6f 67 72 61 6d 6d 69 |scoped p|rogrammi|
|000001b0| 6e 67 0a 6c 61 6e 67 75 | 61 67 65 2e 20 20 45 61 |ng.langu|age. Ea|
|000001c0| 63 68 20 75 73 65 20 6f | 66 20 61 20 76 61 72 69 |ch use o|f a vari|
|000001d0| 61 62 6c 65 20 69 73 20 | 61 73 73 6f 63 69 61 74 |able is |associat|
|000001e0| 65 64 20 77 69 74 68 20 | 61 20 6c 65 78 69 63 61 |ed with |a lexica|
|000001f0| 6c 6c 79 0a 61 70 70 61 | 72 65 6e 74 20 62 69 6e |lly.appa|rent bin|
|00000200| 64 69 6e 67 20 6f 66 20 | 74 68 61 74 20 76 61 72 |ding of |that var|
|00000210| 69 61 62 6c 65 2e 0a 0a | 5c 76 65 73 74 20 53 63 |iable...|\vest Sc|
|00000220| 68 65 6d 65 20 68 61 73 | 20 6c 61 74 65 6e 74 20 |heme has| latent |
|00000230| 61 73 20 6f 70 70 6f 73 | 65 64 20 74 6f 20 6d 61 |as oppos|ed to ma|
|00000240| 6e 69 66 65 73 74 20 74 | 79 70 65 73 2e 20 20 54 |nifest t|ypes. T|
|00000250| 79 70 65 73 0a 61 72 65 | 20 61 73 73 6f 63 69 61 |ypes.are| associa|
|00000260| 74 65 64 20 77 69 74 68 | 20 76 61 6c 75 65 73 20 |ted with| values |
|00000270| 28 61 6c 73 6f 20 63 61 | 6c 6c 65 64 20 6f 62 6a |(also ca|lled obj|
|00000280| 65 63 74 73 5c 6d 61 69 | 6e 69 6e 64 65 78 7b 6f |ects\mai|nindex{o|
|00000290| 62 6a 65 63 74 7d 29 20 | 72 61 74 68 65 72 20 74 |bject}) |rather t|
|000002a0| 68 61 6e 0a 77 69 74 68 | 20 76 61 72 69 61 62 6c |han.with| variabl|
|000002b0| 65 73 2e 20 20 28 53 6f | 6d 65 20 61 75 74 68 6f |es. (So|me autho|
|000002c0| 72 73 20 72 65 66 65 72 | 20 74 6f 20 6c 61 6e 67 |rs refer| to lang|
|000002d0| 75 61 67 65 73 20 77 69 | 74 68 20 6c 61 74 65 6e |uages wi|th laten|
|000002e0| 74 20 74 79 70 65 73 20 | 61 73 0a 77 65 61 6b 6c |t types |as.weakl|
|000002f0| 79 20 74 79 70 65 64 20 | 6f 72 20 64 79 6e 61 6d |y typed |or dynam|
|00000300| 69 63 61 6c 6c 79 20 74 | 79 70 65 64 20 6c 61 6e |ically t|yped lan|
|00000310| 67 75 61 67 65 73 2e 29 | 20 20 4f 74 68 65 72 20 |guages.)| Other |
|00000320| 6c 61 6e 67 75 61 67 65 | 73 20 77 69 74 68 0a 6c |language|s with.l|
|00000330| 61 74 65 6e 74 20 74 79 | 70 65 73 20 61 72 65 20 |atent ty|pes are |
|00000340| 41 50 4c 2c 20 53 6e 6f | 62 6f 6c 2c 20 61 6e 64 |APL, Sno|bol, and|
|00000350| 20 6f 74 68 65 72 20 64 | 69 61 6c 65 63 74 73 20 | other d|ialects |
|00000360| 6f 66 20 4c 69 73 70 2e | 20 20 4c 61 6e 67 75 61 |of Lisp.| Langua|
|00000370| 67 65 73 0a 77 69 74 68 | 20 6d 61 6e 69 66 65 73 |ges.with| manifes|
|00000380| 74 20 74 79 70 65 73 20 | 28 73 6f 6d 65 74 69 6d |t types |(sometim|
|00000390| 65 73 20 72 65 66 65 72 | 72 65 64 20 74 6f 20 61 |es refer|red to a|
|000003a0| 73 20 73 74 72 6f 6e 67 | 6c 79 20 74 79 70 65 64 |s strong|ly typed|
|000003b0| 20 6f 72 0a 73 74 61 74 | 69 63 61 6c 6c 79 20 74 | or.stat|ically t|
|000003c0| 79 70 65 64 20 6c 61 6e | 67 75 61 67 65 73 29 20 |yped lan|guages) |
|000003d0| 69 6e 63 6c 75 64 65 20 | 41 6c 67 6f 6c 20 36 30 |include |Algol 60|
|000003e0| 2c 20 50 61 73 63 61 6c | 2c 20 61 6e 64 7e 43 2e |, Pascal|, and~C.|
|000003f0| 0a 0a 5c 76 65 73 74 20 | 41 6c 6c 20 6f 62 6a 65 |..\vest |All obje|
|00000400| 63 74 73 20 63 72 65 61 | 74 65 64 20 69 6e 20 74 |cts crea|ted in t|
|00000410| 68 65 20 63 6f 75 72 73 | 65 20 6f 66 20 61 20 53 |he cours|e of a S|
|00000420| 63 68 65 6d 65 20 63 6f | 6d 70 75 74 61 74 69 6f |cheme co|mputatio|
|00000430| 6e 2c 20 69 6e 63 6c 75 | 64 69 6e 67 0a 70 72 6f |n, inclu|ding.pro|
|00000440| 63 65 64 75 72 65 73 20 | 61 6e 64 20 63 6f 6e 74 |cedures |and cont|
|00000450| 69 6e 75 61 74 69 6f 6e | 73 2c 20 68 61 76 65 20 |inuation|s, have |
|00000460| 75 6e 6c 69 6d 69 74 65 | 64 20 65 78 74 65 6e 74 |unlimite|d extent|
|00000470| 2e 0a 4e 6f 20 53 63 68 | 65 6d 65 20 6f 62 6a 65 |..No Sch|eme obje|
|00000480| 63 74 20 69 73 20 65 76 | 65 72 20 64 65 73 74 72 |ct is ev|er destr|
|00000490| 6f 79 65 64 2e 20 20 54 | 68 65 20 72 65 61 73 6f |oyed. T|he reaso|
|000004a0| 6e 20 74 68 61 74 0a 69 | 6d 70 6c 65 6d 65 6e 74 |n that.i|mplement|
|000004b0| 61 74 69 6f 6e 73 20 6f | 66 20 53 63 68 65 6d 65 |ations o|f Scheme|
|000004c0| 20 64 6f 20 6e 6f 74 20 | 28 75 73 75 61 6c 6c 79 | do not |(usually|
|000004d0| 21 29 5c 20 72 75 6e 20 | 6f 75 74 20 6f 66 20 73 |!)\ run |out of s|
|000004e0| 74 6f 72 61 67 65 20 69 | 73 20 74 68 61 74 0a 74 |torage i|s that.t|
|000004f0| 68 65 79 20 61 72 65 20 | 70 65 72 6d 69 74 74 65 |hey are |permitte|
|00000500| 64 20 74 6f 20 72 65 63 | 6c 61 69 6d 20 74 68 65 |d to rec|laim the|
|00000510| 20 73 74 6f 72 61 67 65 | 20 6f 63 63 75 70 69 65 | storage| occupie|
|00000520| 64 20 62 79 20 61 6e 20 | 6f 62 6a 65 63 74 20 69 |d by an |object i|
|00000530| 66 0a 74 68 65 79 20 63 | 61 6e 20 70 72 6f 76 65 |f.they c|an prove|
|00000540| 20 74 68 61 74 20 74 68 | 65 20 6f 62 6a 65 63 74 | that th|e object|
|00000550| 20 63 61 6e 6e 6f 74 20 | 70 6f 73 73 69 62 6c 79 | cannot |possibly|
|00000560| 20 6d 61 74 74 65 72 20 | 74 6f 20 61 6e 79 20 66 | matter |to any f|
|00000570| 75 74 75 72 65 0a 63 6f | 6d 70 75 74 61 74 69 6f |uture.co|mputatio|
|00000580| 6e 2e 20 20 4f 74 68 65 | 72 20 6c 61 6e 67 75 61 |n. Othe|r langua|
|00000590| 67 65 73 20 69 6e 20 77 | 68 69 63 68 20 6d 6f 73 |ges in w|hich mos|
|000005a0| 74 20 6f 62 6a 65 63 74 | 73 20 68 61 76 65 20 75 |t object|s have u|
|000005b0| 6e 6c 69 6d 69 74 65 64 | 0a 65 78 74 65 6e 74 20 |nlimited|.extent |
|000005c0| 69 6e 63 6c 75 64 65 20 | 41 50 4c 20 61 6e 64 20 |include |APL and |
|000005d0| 6f 74 68 65 72 20 4c 69 | 73 70 20 64 69 61 6c 65 |other Li|sp diale|
|000005e0| 63 74 73 2e 0a 0a 5c 76 | 65 73 74 20 49 6d 70 6c |cts...\v|est Impl|
|000005f0| 65 6d 65 6e 74 61 74 69 | 6f 6e 73 20 6f 66 20 53 |ementati|ons of S|
|00000600| 63 68 65 6d 65 20 61 72 | 65 20 72 65 71 75 69 72 |cheme ar|e requir|
|00000610| 65 64 20 74 6f 20 62 65 | 20 70 72 6f 70 65 72 6c |ed to be| properl|
|00000620| 79 20 74 61 69 6c 2d 72 | 65 63 75 72 73 69 76 65 |y tail-r|ecursive|
|00000630| 2e 0a 54 68 69 73 20 61 | 6c 6c 6f 77 73 20 74 68 |..This a|llows th|
|00000640| 65 20 65 78 65 63 75 74 | 69 6f 6e 20 6f 66 20 61 |e execut|ion of a|
|00000650| 6e 20 69 74 65 72 61 74 | 69 76 65 20 63 6f 6d 70 |n iterat|ive comp|
|00000660| 75 74 61 74 69 6f 6e 20 | 69 6e 20 63 6f 6e 73 74 |utation |in const|
|00000670| 61 6e 74 20 73 70 61 63 | 65 2c 0a 65 76 65 6e 20 |ant spac|e,.even |
|00000680| 69 66 20 74 68 65 20 69 | 74 65 72 61 74 69 76 65 |if the i|terative|
|00000690| 20 63 6f 6d 70 75 74 61 | 74 69 6f 6e 20 69 73 20 | computa|tion is |
|000006a0| 64 65 73 63 72 69 62 65 | 64 20 62 79 20 61 20 73 |describe|d by a s|
|000006b0| 79 6e 74 61 63 74 69 63 | 61 6c 6c 79 0a 72 65 63 |yntactic|ally.rec|
|000006c0| 75 72 73 69 76 65 20 70 | 72 6f 63 65 64 75 72 65 |ursive p|rocedure|
|000006d0| 2e 20 20 54 68 75 73 20 | 77 69 74 68 20 61 20 74 |. Thus |with a t|
|000006e0| 61 69 6c 2d 72 65 63 75 | 72 73 69 76 65 20 69 6d |ail-recu|rsive im|
|000006f0| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 2c 0a 69 74 |plementa|tion,.it|
|00000700| 65 72 61 74 69 6f 6e 20 | 63 61 6e 20 62 65 20 65 |eration |can be e|
|00000710| 78 70 72 65 73 73 65 64 | 20 75 73 69 6e 67 20 74 |xpressed| using t|
|00000720| 68 65 20 6f 72 64 69 6e | 61 72 79 20 70 72 6f 63 |he ordin|ary proc|
|00000730| 65 64 75 72 65 2d 63 61 | 6c 6c 0a 6d 65 63 68 61 |edure-ca|ll.mecha|
|00000740| 6e 69 63 73 2c 20 73 6f | 20 74 68 61 74 20 73 70 |nics, so| that sp|
|00000750| 65 63 69 61 6c 20 69 74 | 65 72 61 74 69 6f 6e 20 |ecial it|eration |
|00000760| 63 6f 6e 73 74 72 75 63 | 74 73 20 61 72 65 20 75 |construc|ts are u|
|00000770| 73 65 66 75 6c 20 6f 6e | 6c 79 20 61 73 0a 73 79 |seful on|ly as.sy|
|00000780| 6e 74 61 63 74 69 63 20 | 73 75 67 61 72 2e 0a 0a |ntactic |sugar...|
|00000790| 5c 76 65 73 74 20 53 63 | 68 65 6d 65 20 70 72 6f |\vest Sc|heme pro|
|000007a0| 63 65 64 75 72 65 73 20 | 61 72 65 20 6f 62 6a 65 |cedures |are obje|
|000007b0| 63 74 73 20 69 6e 20 74 | 68 65 69 72 20 6f 77 6e |cts in t|heir own|
|000007c0| 20 72 69 67 68 74 2e 20 | 20 50 72 6f 63 65 64 75 | right. | Procedu|
|000007d0| 72 65 73 20 63 61 6e 20 | 62 65 0a 63 72 65 61 74 |res can |be.creat|
|000007e0| 65 64 20 64 79 6e 61 6d | 69 63 61 6c 6c 79 2c 20 |ed dynam|ically, |
|000007f0| 73 74 6f 72 65 64 20 69 | 6e 20 64 61 74 61 20 73 |stored i|n data s|
|00000800| 74 72 75 63 74 75 72 65 | 73 2c 20 72 65 74 75 72 |tructure|s, retur|
|00000810| 6e 65 64 20 61 73 20 72 | 65 73 75 6c 74 73 20 6f |ned as r|esults o|
|00000820| 66 0a 70 72 6f 63 65 64 | 75 72 65 73 2c 20 61 6e |f.proced|ures, an|
|00000830| 64 20 73 6f 20 6f 6e 2e | 20 20 4f 74 68 65 72 20 |d so on.| Other |
|00000840| 6c 61 6e 67 75 61 67 65 | 73 20 77 69 74 68 20 74 |language|s with t|
|00000850| 68 65 73 65 20 70 72 6f | 70 65 72 74 69 65 73 20 |hese pro|perties |
|00000860| 69 6e 63 6c 75 64 65 0a | 43 6f 6d 6d 6f 6e 20 4c |include.|Common L|
|00000870| 69 73 70 20 61 6e 64 20 | 4d 4c 2e 20 5c 74 6f 64 |isp and |ML. \tod|
|00000880| 6f 7b 52 6f 7a 61 73 3a | 20 53 63 68 65 6d 65 20 |o{Rozas:| Scheme |
|00000890| 68 61 64 20 74 68 65 6d | 20 66 69 72 73 74 2e 7d |had them| first.}|
|000008a0| 0a 0a 5c 76 65 73 74 20 | 4f 6e 65 20 64 69 73 74 |..\vest |One dist|
|000008b0| 69 6e 67 75 69 73 68 69 | 6e 67 20 66 65 61 74 75 |inguishi|ng featu|
|000008c0| 72 65 20 6f 66 20 53 63 | 68 65 6d 65 20 69 73 20 |re of Sc|heme is |
|000008d0| 74 68 61 74 20 63 6f 6e | 74 69 6e 75 61 74 69 6f |that con|tinuatio|
|000008e0| 6e 73 2c 20 77 68 69 63 | 68 0a 69 6e 20 6d 6f 73 |ns, whic|h.in mos|
|000008f0| 74 20 6f 74 68 65 72 20 | 6c 61 6e 67 75 61 67 65 |t other |language|
|00000900| 73 20 6f 6e 6c 79 20 6f | 70 65 72 61 74 65 20 62 |s only o|perate b|
|00000910| 65 68 69 6e 64 20 74 68 | 65 20 73 63 65 6e 65 73 |ehind th|e scenes|
|00000920| 2c 20 61 6c 73 6f 20 68 | 61 76 65 0a 60 60 66 69 |, also h|ave.``fi|
|00000930| 72 73 74 2d 63 6c 61 73 | 73 27 27 20 73 74 61 74 |rst-clas|s'' stat|
|00000940| 75 73 2e 20 20 43 6f 6e | 74 69 6e 75 61 74 69 6f |us. Con|tinuatio|
|00000950| 6e 73 20 61 72 65 20 75 | 73 65 66 75 6c 20 66 6f |ns are u|seful fo|
|00000960| 72 20 69 6d 70 6c 65 6d | 65 6e 74 69 6e 67 20 61 |r implem|enting a|
|00000970| 0a 77 69 64 65 20 76 61 | 72 69 65 74 79 20 6f 66 |.wide va|riety of|
|00000980| 20 61 64 76 61 6e 63 65 | 64 20 63 6f 6e 74 72 6f | advance|d contro|
|00000990| 6c 20 63 6f 6e 73 74 72 | 75 63 74 73 2c 20 69 6e |l constr|ucts, in|
|000009a0| 63 6c 75 64 69 6e 67 20 | 6e 6f 6e 2d 6c 6f 63 61 |cluding |non-loca|
|000009b0| 6c 20 65 78 69 74 73 2c | 0a 62 61 63 6b 74 72 61 |l exits,|.backtra|
|000009c0| 63 6b 69 6e 67 2c 20 61 | 6e 64 20 63 6f 72 6f 75 |cking, a|nd corou|
|000009d0| 74 69 6e 65 73 2e 20 20 | 53 65 65 20 73 65 63 74 |tines. |See sect|
|000009e0| 69 6f 6e 7e 5c 72 65 66 | 7b 63 6f 6e 74 69 6e 75 |ion~\ref|{continu|
|000009f0| 61 74 69 6f 6e 73 7d 2e | 0a 0a 5c 76 65 73 74 20 |ations}.|..\vest |
|00000a00| 41 72 67 75 6d 65 6e 74 | 73 20 74 6f 20 53 63 68 |Argument|s to Sch|
|00000a10| 65 6d 65 20 70 72 6f 63 | 65 64 75 72 65 73 20 61 |eme proc|edures a|
|00000a20| 72 65 20 61 6c 77 61 79 | 73 20 70 61 73 73 65 64 |re alway|s passed|
|00000a30| 20 62 79 20 76 61 6c 75 | 65 2c 20 77 68 69 63 68 | by valu|e, which|
|00000a40| 0a 6d 65 61 6e 73 20 74 | 68 61 74 20 74 68 65 20 |.means t|hat the |
|00000a50| 61 63 74 75 61 6c 20 61 | 72 67 75 6d 65 6e 74 20 |actual a|rgument |
|00000a60| 65 78 70 72 65 73 73 69 | 6f 6e 73 20 61 72 65 20 |expressi|ons are |
|00000a70| 65 76 61 6c 75 61 74 65 | 64 20 62 65 66 6f 72 65 |evaluate|d before|
|00000a80| 20 74 68 65 0a 70 72 6f | 63 65 64 75 72 65 20 67 | the.pro|cedure g|
|00000a90| 61 69 6e 73 20 63 6f 6e | 74 72 6f 6c 2c 20 77 68 |ains con|trol, wh|
|00000aa0| 65 74 68 65 72 20 74 68 | 65 20 70 72 6f 63 65 64 |ether th|e proced|
|00000ab0| 75 72 65 20 6e 65 65 64 | 73 20 74 68 65 20 72 65 |ure need|s the re|
|00000ac0| 73 75 6c 74 20 6f 66 20 | 74 68 65 0a 65 76 61 6c |sult of |the.eval|
|00000ad0| 75 61 74 69 6f 6e 20 6f | 72 20 6e 6f 74 2e 20 20 |uation o|r not. |
|00000ae0| 4d 4c 2c 20 43 2c 20 61 | 6e 64 20 41 50 4c 20 61 |ML, C, a|nd APL a|
|00000af0| 72 65 20 74 68 72 65 65 | 20 6f 74 68 65 72 20 6c |re three| other l|
|00000b00| 61 6e 67 75 61 67 65 73 | 20 74 68 61 74 20 61 6c |anguages| that al|
|00000b10| 77 61 79 73 0a 70 61 73 | 73 20 61 72 67 75 6d 65 |ways.pas|s argume|
|00000b20| 6e 74 73 20 62 79 20 76 | 61 6c 75 65 2e 0a 54 68 |nts by v|alue..Th|
|00000b30| 69 73 20 69 73 20 64 69 | 73 74 69 6e 63 74 20 66 |is is di|stinct f|
|00000b40| 72 6f 6d 20 74 68 65 20 | 6c 61 7a 79 2d 65 76 61 |rom the |lazy-eva|
|00000b50| 6c 75 61 74 69 6f 6e 20 | 73 65 6d 61 6e 74 69 63 |luation |semantic|
|00000b60| 73 20 6f 66 20 48 61 73 | 6b 65 6c 6c 2c 0a 6f 72 |s of Has|kell,.or|
|00000b70| 20 74 68 65 20 63 61 6c | 6c 2d 62 79 2d 6e 61 6d | the cal|l-by-nam|
|00000b80| 65 20 73 65 6d 61 6e 74 | 69 63 73 20 6f 66 20 41 |e semant|ics of A|
|00000b90| 6c 67 6f 6c 20 36 30 2c | 20 77 68 65 72 65 20 61 |lgol 60,| where a|
|00000ba0| 6e 20 61 72 67 75 6d 65 | 6e 74 0a 65 78 70 72 65 |n argume|nt.expre|
|00000bb0| 73 73 69 6f 6e 20 69 73 | 20 6e 6f 74 20 65 76 61 |ssion is| not eva|
|00000bc0| 6c 75 61 74 65 64 20 75 | 6e 6c 65 73 73 20 69 74 |luated u|nless it|
|00000bd0| 73 20 76 61 6c 75 65 20 | 69 73 20 6e 65 65 64 65 |s value |is neede|
|00000be0| 64 20 62 79 20 74 68 65 | 0a 70 72 6f 63 65 64 75 |d by the|.procedu|
|00000bf0| 72 65 2e 0a 0a 5c 74 6f | 64 6f 7b 4c 69 73 70 27 |re...\to|do{Lisp'|
|00000c00| 73 20 63 61 6c 6c 20 62 | 79 20 76 61 6c 75 65 20 |s call b|y value |
|00000c10| 73 68 6f 75 6c 64 20 62 | 65 20 65 78 70 6c 61 69 |should b|e explai|
|00000c20| 6e 65 64 20 6d 6f 72 65 | 0a 61 63 63 75 72 61 74 |ned more|.accurat|
|00000c30| 65 6c 79 2e 20 20 57 68 | 61 74 27 73 20 66 75 6e |ely. Wh|at's fun|
|00000c40| 6e 79 20 69 73 20 74 68 | 61 74 20 61 6c 6c 20 76 |ny is th|at all v|
|00000c50| 61 6c 75 65 73 20 61 72 | 65 20 72 65 66 65 72 65 |alues ar|e refere|
|00000c60| 6e 63 65 73 2e 7d 0a 0a | 5c 76 65 73 74 20 53 63 |nces.}..|\vest Sc|
|00000c70| 68 65 6d 65 27 73 20 6d | 6f 64 65 6c 20 6f 66 20 |heme's m|odel of |
|00000c80| 61 72 69 74 68 6d 65 74 | 69 63 20 69 73 20 64 65 |arithmet|ic is de|
|00000c90| 73 69 67 6e 65 64 20 74 | 6f 20 72 65 6d 61 69 6e |signed t|o remain|
|00000ca0| 20 61 73 20 69 6e 64 65 | 70 65 6e 64 65 6e 74 20 | as inde|pendent |
|00000cb0| 61 73 0a 70 6f 73 73 69 | 62 6c 65 20 6f 66 20 74 |as.possi|ble of t|
|00000cc0| 68 65 20 70 61 72 74 69 | 63 75 6c 61 72 20 77 61 |he parti|cular wa|
|00000cd0| 79 73 20 69 6e 20 77 68 | 69 63 68 20 6e 75 6d 62 |ys in wh|ich numb|
|00000ce0| 65 72 73 20 61 72 65 20 | 72 65 70 72 65 73 65 6e |ers are |represen|
|00000cf0| 74 65 64 20 77 69 74 68 | 69 6e 20 61 0a 63 6f 6d |ted with|in a.com|
|00000d00| 70 75 74 65 72 2e 20 49 | 6e 20 53 63 68 65 6d 65 |puter. I|n Scheme|
|00000d10| 2c 20 65 76 65 72 79 20 | 69 6e 74 65 67 65 72 20 |, every |integer |
|00000d20| 69 73 20 61 20 72 61 74 | 69 6f 6e 61 6c 20 6e 75 |is a rat|ional nu|
|00000d30| 6d 62 65 72 2c 20 65 76 | 65 72 79 20 72 61 74 69 |mber, ev|ery rati|
|00000d40| 6f 6e 61 6c 20 69 73 20 | 61 0a 72 65 61 6c 2c 20 |onal is |a.real, |
|00000d50| 61 6e 64 20 65 76 65 72 | 79 20 72 65 61 6c 20 69 |and ever|y real i|
|00000d60| 73 20 61 20 63 6f 6d 70 | 6c 65 78 20 6e 75 6d 62 |s a comp|lex numb|
|00000d70| 65 72 2e 20 20 54 68 75 | 73 20 74 68 65 20 64 69 |er. Thu|s the di|
|00000d80| 73 74 69 6e 63 74 69 6f | 6e 20 62 65 74 77 65 65 |stinctio|n betwee|
|00000d90| 6e 20 69 6e 74 65 67 65 | 72 0a 61 6e 64 20 72 65 |n intege|r.and re|
|00000da0| 61 6c 20 61 72 69 74 68 | 6d 65 74 69 63 2c 20 73 |al arith|metic, s|
|00000db0| 6f 20 69 6d 70 6f 72 74 | 61 6e 74 20 74 6f 20 6d |o import|ant to m|
|00000dc0| 61 6e 79 20 70 72 6f 67 | 72 61 6d 6d 69 6e 67 20 |any prog|ramming |
|00000dd0| 6c 61 6e 67 75 61 67 65 | 73 2c 20 64 6f 65 73 20 |language|s, does |
|00000de0| 6e 6f 74 0a 61 70 70 65 | 61 72 20 69 6e 20 53 63 |not.appe|ar in Sc|
|00000df0| 68 65 6d 65 2e 20 20 49 | 6e 20 69 74 73 20 70 6c |heme. I|n its pl|
|00000e00| 61 63 65 20 69 73 20 61 | 20 64 69 73 74 69 6e 63 |ace is a| distinc|
|00000e10| 74 69 6f 6e 20 62 65 74 | 77 65 65 6e 20 65 78 61 |tion bet|ween exa|
|00000e20| 63 74 20 61 72 69 74 68 | 6d 65 74 69 63 2c 0a 77 |ct arith|metic,.w|
|00000e30| 68 69 63 68 20 63 6f 72 | 72 65 73 70 6f 6e 64 73 |hich cor|responds|
|00000e40| 20 74 6f 20 74 68 65 20 | 6d 61 74 68 65 6d 61 74 | to the |mathemat|
|00000e50| 69 63 61 6c 20 69 64 65 | 61 6c 2c 20 61 6e 64 20 |ical ide|al, and |
|00000e60| 69 6e 65 78 61 63 74 20 | 61 72 69 74 68 6d 65 74 |inexact |arithmet|
|00000e70| 69 63 20 6f 6e 0a 61 70 | 70 72 6f 78 69 6d 61 74 |ic on.ap|proximat|
|00000e80| 69 6f 6e 73 2e 20 20 41 | 73 20 69 6e 20 43 6f 6d |ions. A|s in Com|
|00000e90| 6d 6f 6e 20 4c 69 73 70 | 2c 20 65 78 61 63 74 20 |mon Lisp|, exact |
|00000ea0| 61 72 69 74 68 6d 65 74 | 69 63 20 69 73 20 6e 6f |arithmet|ic is no|
|00000eb0| 74 20 6c 69 6d 69 74 65 | 64 20 74 6f 0a 69 6e 74 |t limite|d to.int|
|00000ec0| 65 67 65 72 73 2e 0a 0a | 0a 5c 73 65 63 74 69 6f |egers...|.\sectio|
|00000ed0| 6e 7b 53 79 6e 74 61 78 | 7d 0a 0a 53 63 68 65 6d |n{Syntax|}..Schem|
|00000ee0| 65 2c 20 6c 69 6b 65 20 | 6d 6f 73 74 20 64 69 61 |e, like |most dia|
|00000ef0| 6c 65 63 74 73 20 6f 66 | 20 4c 69 73 70 2c 20 65 |lects of| Lisp, e|
|00000f00| 6d 70 6c 6f 79 73 20 61 | 20 66 75 6c 6c 79 20 70 |mploys a| fully p|
|00000f10| 61 72 65 6e 74 68 65 73 | 69 7a 65 64 20 70 72 65 |arenthes|ized pre|
|00000f20| 66 69 78 0a 6e 6f 74 61 | 74 69 6f 6e 20 66 6f 72 |fix.nota|tion for|
|00000f30| 20 70 72 6f 67 72 61 6d | 73 20 61 6e 64 20 28 6f | program|s and (o|
|00000f40| 74 68 65 72 29 20 64 61 | 74 61 3b 20 74 68 65 20 |ther) da|ta; the |
|00000f50| 67 72 61 6d 6d 61 72 20 | 6f 66 20 53 63 68 65 6d |grammar |of Schem|
|00000f60| 65 20 67 65 6e 65 72 61 | 74 65 73 20 61 0a 73 75 |e genera|tes a.su|
|00000f70| 62 6c 61 6e 67 75 61 67 | 65 20 6f 66 20 74 68 65 |blanguag|e of the|
|00000f80| 20 6c 61 6e 67 75 61 67 | 65 20 75 73 65 64 20 66 | languag|e used f|
|00000f90| 6f 72 20 64 61 74 61 2e | 20 20 41 6e 20 69 6d 70 |or data.| An imp|
|00000fa0| 6f 72 74 61 6e 74 0a 63 | 6f 6e 73 65 71 75 65 6e |ortant.c|onsequen|
|00000fb0| 63 65 20 6f 66 20 74 68 | 69 73 20 73 69 6d 70 6c |ce of th|is simpl|
|00000fc0| 65 2c 20 75 6e 69 66 6f | 72 6d 20 72 65 70 72 65 |e, unifo|rm repre|
|00000fd0| 73 65 6e 74 61 74 69 6f | 6e 20 69 73 20 74 68 65 |sentatio|n is the|
|00000fe0| 20 73 75 73 63 65 70 74 | 69 62 69 6c 69 74 79 20 | suscept|ibility |
|00000ff0| 6f 66 0a 53 63 68 65 6d | 65 20 70 72 6f 67 72 61 |of.Schem|e progra|
|00001000| 6d 73 20 61 6e 64 20 64 | 61 74 61 20 74 6f 20 75 |ms and d|ata to u|
|00001010| 6e 69 66 6f 72 6d 20 74 | 72 65 61 74 6d 65 6e 74 |niform t|reatment|
|00001020| 20 62 79 20 6f 74 68 65 | 72 20 53 63 68 65 6d 65 | by othe|r Scheme|
|00001030| 20 70 72 6f 67 72 61 6d | 73 2e 0a 0a 54 68 65 20 | program|s...The |
|00001040| 5c 69 64 65 7b 72 65 61 | 64 7d 20 70 72 6f 63 65 |\ide{rea|d} proce|
|00001050| 64 75 72 65 20 70 65 72 | 66 6f 72 6d 73 20 73 79 |dure per|forms sy|
|00001060| 6e 74 61 63 74 69 63 20 | 61 73 20 77 65 6c 6c 20 |ntactic |as well |
|00001070| 61 73 20 6c 65 78 69 63 | 61 6c 20 64 65 63 6f 6d |as lexic|al decom|
|00001080| 70 6f 73 69 74 69 6f 6e | 20 6f 66 0a 74 68 65 20 |position| of.the |
|00001090| 64 61 74 61 20 69 74 20 | 72 65 61 64 73 2e 20 20 |data it |reads. |
|000010a0| 54 68 65 20 5c 69 64 65 | 7b 72 65 61 64 7d 20 70 |The \ide|{read} p|
|000010b0| 72 6f 63 65 64 75 72 65 | 20 70 61 72 73 65 73 20 |rocedure| parses |
|000010c0| 69 74 73 20 69 6e 70 75 | 74 20 61 73 20 64 61 74 |its inpu|t as dat|
|000010d0| 61 0a 28 73 65 63 74 69 | 6f 6e 7e 5c 72 65 66 7b |a.(secti|on~\ref{|
|000010e0| 64 61 74 75 6d 73 79 6e | 74 61 78 7d 29 2c 20 6e |datumsyn|tax}), n|
|000010f0| 6f 74 20 61 73 20 70 72 | 6f 67 72 61 6d 2e 0a 0a |ot as pr|ogram...|
|00001100| 54 68 65 20 66 6f 72 6d | 61 6c 20 73 79 6e 74 61 |The form|al synta|
|00001110| 78 20 6f 66 20 53 63 68 | 65 6d 65 20 69 73 20 64 |x of Sch|eme is d|
|00001120| 65 73 63 72 69 62 65 64 | 20 69 6e 20 73 65 63 74 |escribed| in sect|
|00001130| 69 6f 6e 7e 5c 72 65 66 | 7b 42 4e 46 7d 2e 0a 0a |ion~\ref|{BNF}...|
|00001140| 0a 5c 73 65 63 74 69 6f | 6e 7b 4e 6f 74 61 74 69 |.\sectio|n{Notati|
|00001150| 6f 6e 20 61 6e 64 20 74 | 65 72 6d 69 6e 6f 6c 6f |on and t|erminolo|
|00001160| 67 79 7d 0a 0a 0a 5c 73 | 75 62 73 65 63 74 69 6f |gy}...\s|ubsectio|
|00001170| 6e 7b 45 73 73 65 6e 74 | 69 61 6c 20 61 6e 64 20 |n{Essent|ial and |
|00001180| 6e 6f 6e 2d 65 73 73 65 | 6e 74 69 61 6c 20 66 65 |non-esse|ntial fe|
|00001190| 61 74 75 72 65 73 7d 0a | 0a 5c 6c 61 62 65 6c 7b |atures}.|.\label{|
|000011a0| 65 73 73 65 6e 74 69 61 | 6c 73 65 63 74 69 6f 6e |essentia|lsection|
|000011b0| 7d 0a 49 74 20 69 73 20 | 72 65 71 75 69 72 65 64 |}.It is |required|
|000011c0| 20 74 68 61 74 20 65 76 | 65 72 79 20 69 6d 70 6c | that ev|ery impl|
|000011d0| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 6f 66 20 53 63 |ementati|on of Sc|
|000011e0| 68 65 6d 65 20 73 75 70 | 70 6f 72 74 0a 66 65 61 |heme sup|port.fea|
|000011f0| 74 75 72 65 73 20 74 68 | 61 74 20 61 72 65 20 6d |tures th|at are m|
|00001200| 61 72 6b 65 64 20 61 73 | 20 62 65 69 6e 67 20 5c |arked as| being \|
|00001210| 64 65 66 69 6e 69 6e 67 | 7b 65 73 73 65 6e 74 69 |defining|{essenti|
|00001220| 61 6c 7d 2e 20 20 46 65 | 61 74 75 72 65 73 20 6e |al}. Fe|atures n|
|00001230| 6f 74 0a 65 78 70 6c 69 | 63 69 74 6c 79 20 6d 61 |ot.expli|citly ma|
|00001240| 72 6b 65 64 20 61 73 20 | 65 73 73 65 6e 74 69 61 |rked as |essentia|
|00001250| 6c 20 61 72 65 20 6e 6f | 74 20 65 73 73 65 6e 74 |l are no|t essent|
|00001260| 69 61 6c 2e 20 20 49 6d | 70 6c 65 6d 65 6e 74 61 |ial. Im|plementa|
|00001270| 74 69 6f 6e 73 20 61 72 | 65 0a 66 72 65 65 20 74 |tions ar|e.free t|
|00001280| 6f 20 6f 6d 69 74 20 6e | 6f 6e 2d 65 73 73 65 6e |o omit n|on-essen|
|00001290| 74 69 61 6c 20 66 65 61 | 74 75 72 65 73 20 6f 66 |tial fea|tures of|
|000012a0| 20 53 63 68 65 6d 65 20 | 6f 72 20 74 6f 20 61 64 | Scheme |or to ad|
|000012b0| 64 20 65 78 74 65 6e 73 | 69 6f 6e 73 2c 0a 70 72 |d extens|ions,.pr|
|000012c0| 6f 76 69 64 65 64 20 74 | 68 65 20 65 78 74 65 6e |ovided t|he exten|
|000012d0| 73 69 6f 6e 73 20 61 72 | 65 20 6e 6f 74 20 69 6e |sions ar|e not in|
|000012e0| 20 63 6f 6e 66 6c 69 63 | 74 20 77 69 74 68 20 74 | conflic|t with t|
|000012f0| 68 65 20 6c 61 6e 67 75 | 61 67 65 20 72 65 70 6f |he langu|age repo|
|00001300| 72 74 65 64 0a 68 65 72 | 65 2e 20 20 49 6e 20 70 |rted.her|e. In p|
|00001310| 61 72 74 69 63 75 6c 61 | 72 2c 20 69 6d 70 6c 65 |articula|r, imple|
|00001320| 6d 65 6e 74 61 74 69 6f | 6e 73 20 6d 75 73 74 20 |mentatio|ns must |
|00001330| 73 75 70 70 6f 72 74 20 | 70 6f 72 74 61 62 6c 65 |support |portable|
|00001340| 20 63 6f 64 65 20 62 79 | 0a 70 72 6f 76 69 64 69 | code by|.providi|
|00001350| 6e 67 20 61 20 73 79 6e | 74 61 63 74 69 63 20 6d |ng a syn|tactic m|
|00001360| 6f 64 65 20 74 68 61 74 | 20 70 72 65 65 6d 70 74 |ode that| preempt|
|00001370| 73 20 6e 6f 20 6c 65 78 | 69 63 61 6c 20 63 6f 6e |s no lex|ical con|
|00001380| 76 65 6e 74 69 6f 6e 73 | 20 6f 66 20 74 68 69 73 |ventions| of this|
|00001390| 0a 72 65 70 6f 72 74 20 | 61 6e 64 20 72 65 73 65 |.report |and rese|
|000013a0| 72 76 65 73 20 6e 6f 20 | 69 64 65 6e 74 69 66 69 |rves no |identifi|
|000013b0| 65 72 73 20 6f 74 68 65 | 72 20 74 68 61 6e 20 74 |ers othe|r than t|
|000013c0| 68 6f 73 65 20 6c 69 73 | 74 65 64 20 61 73 20 73 |hose lis|ted as s|
|000013d0| 79 6e 74 61 63 74 69 63 | 0a 6b 65 79 77 6f 72 64 |yntactic|.keyword|
|000013e0| 73 20 69 6e 20 73 65 63 | 74 69 6f 6e 7e 5c 72 65 |s in sec|tion~\re|
|000013f0| 66 7b 6b 65 79 77 6f 72 | 64 73 65 63 74 69 6f 6e |f{keywor|dsection|
|00001400| 7d 2e 0a 0a 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |}....\su|bsection|
|00001410| 7b 45 72 72 6f 72 20 73 | 69 74 75 61 74 69 6f 6e |{Error s|ituation|
|00001420| 73 20 61 6e 64 20 75 6e | 73 70 65 63 69 66 69 65 |s and un|specifie|
|00001430| 64 20 62 65 68 61 76 69 | 6f 72 7d 0a 0a 5c 6d 61 |d behavi|or}..\ma|
|00001440| 69 6e 69 6e 64 65 78 7b | 65 72 72 6f 72 7d 0a 57 |inindex{|error}.W|
|00001450| 68 65 6e 20 73 70 65 61 | 6b 69 6e 67 20 6f 66 20 |hen spea|king of |
|00001460| 61 6e 20 65 72 72 6f 72 | 20 73 69 74 75 61 74 69 |an error| situati|
|00001470| 6f 6e 2c 20 74 68 69 73 | 20 72 65 70 6f 72 74 20 |on, this| report |
|00001480| 75 73 65 73 20 74 68 65 | 20 70 68 72 61 73 65 20 |uses the| phrase |
|00001490| 60 60 61 6e 0a 65 72 72 | 6f 72 20 69 73 20 73 69 |``an.err|or is si|
|000014a0| 67 6e 61 6c 6c 65 64 27 | 27 20 74 6f 20 69 6e 64 |gnalled'|' to ind|
|000014b0| 69 63 61 74 65 20 74 68 | 61 74 20 69 6d 70 6c 65 |icate th|at imple|
|000014c0| 6d 65 6e 74 61 74 69 6f | 6e 73 20 6d 75 73 74 20 |mentatio|ns must |
|000014d0| 64 65 74 65 63 74 20 61 | 6e 64 0a 72 65 70 6f 72 |detect a|nd.repor|
|000014e0| 74 20 74 68 65 20 65 72 | 72 6f 72 2e 20 20 49 66 |t the er|ror. If|
|000014f0| 20 73 75 63 68 20 77 6f | 72 64 69 6e 67 20 64 6f | such wo|rding do|
|00001500| 65 73 20 6e 6f 74 20 61 | 70 70 65 61 72 20 69 6e |es not a|ppear in|
|00001510| 20 74 68 65 20 64 69 73 | 63 75 73 73 69 6f 6e 20 | the dis|cussion |
|00001520| 6f 66 0a 61 6e 20 65 72 | 72 6f 72 2c 20 74 68 65 |of.an er|ror, the|
|00001530| 6e 20 69 6d 70 6c 65 6d | 65 6e 74 61 74 69 6f 6e |n implem|entation|
|00001540| 73 20 61 72 65 20 6e 6f | 74 20 72 65 71 75 69 72 |s are no|t requir|
|00001550| 65 64 20 74 6f 20 64 65 | 74 65 63 74 20 6f 72 20 |ed to de|tect or |
|00001560| 72 65 70 6f 72 74 20 74 | 68 65 0a 65 72 72 6f 72 |report t|he.error|
|00001570| 2c 20 74 68 6f 75 67 68 | 20 74 68 65 79 20 61 72 |, though| they ar|
|00001580| 65 20 65 6e 63 6f 75 72 | 61 67 65 64 20 74 6f 20 |e encour|aged to |
|00001590| 64 6f 20 73 6f 2e 20 20 | 41 6e 20 65 72 72 6f 72 |do so. |An error|
|000015a0| 20 73 69 74 75 61 74 69 | 6f 6e 20 74 68 61 74 0a | situati|on that.|
|000015b0| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 73 20 |implemen|tations |
|000015c0| 61 72 65 20 6e 6f 74 20 | 72 65 71 75 69 72 65 64 |are not |required|
|000015d0| 20 74 6f 20 64 65 74 65 | 63 74 20 69 73 20 75 73 | to dete|ct is us|
|000015e0| 75 61 6c 6c 79 20 72 65 | 66 65 72 72 65 64 20 74 |ually re|ferred t|
|000015f0| 6f 20 73 69 6d 70 6c 79 | 0a 61 73 20 60 60 61 6e |o simply|.as ``an|
|00001600| 20 65 72 72 6f 72 2e 27 | 27 0a 0a 5c 76 65 73 74 | error.'|'..\vest|
|00001610| 20 46 6f 72 20 65 78 61 | 6d 70 6c 65 2c 20 69 74 | For exa|mple, it|
|00001620| 20 69 73 20 61 6e 20 65 | 72 72 6f 72 20 66 6f 72 | is an e|rror for|
|00001630| 20 61 20 70 72 6f 63 65 | 64 75 72 65 20 74 6f 20 | a proce|dure to |
|00001640| 62 65 20 70 61 73 73 65 | 64 20 61 6e 20 61 72 67 |be passe|d an arg|
|00001650| 75 6d 65 6e 74 20 74 68 | 61 74 0a 74 68 65 20 70 |ument th|at.the p|
|00001660| 72 6f 63 65 64 75 72 65 | 20 69 73 20 6e 6f 74 20 |rocedure| is not |
|00001670| 65 78 70 6c 69 63 69 74 | 6c 79 20 73 70 65 63 69 |explicit|ly speci|
|00001680| 66 69 65 64 20 74 6f 20 | 68 61 6e 64 6c 65 2c 20 |fied to |handle, |
|00001690| 65 76 65 6e 20 74 68 6f | 75 67 68 20 73 75 63 68 |even tho|ugh such|
|000016a0| 0a 64 6f 6d 61 69 6e 20 | 65 72 72 6f 72 73 20 61 |.domain |errors a|
|000016b0| 72 65 20 73 65 6c 64 6f | 6d 20 6d 65 6e 74 69 6f |re seldo|m mentio|
|000016c0| 6e 65 64 20 69 6e 20 74 | 68 69 73 20 72 65 70 6f |ned in t|his repo|
|000016d0| 72 74 2e 20 20 49 6d 70 | 6c 65 6d 65 6e 74 61 74 |rt. Imp|lementat|
|000016e0| 69 6f 6e 73 20 6d 61 79 | 0a 65 78 74 65 6e 64 20 |ions may|.extend |
|000016f0| 61 20 70 72 6f 63 65 64 | 75 72 65 27 73 20 64 6f |a proced|ure's do|
|00001700| 6d 61 69 6e 20 6f 66 20 | 64 65 66 69 6e 69 74 69 |main of |definiti|
|00001710| 6f 6e 20 74 6f 20 69 6e | 63 6c 75 64 65 20 73 75 |on to in|clude su|
|00001720| 63 68 20 61 72 67 75 6d | 65 6e 74 73 2e 0a 0a 5c |ch argum|ents...\|
|00001730| 76 65 73 74 20 54 68 69 | 73 20 72 65 70 6f 72 74 |vest Thi|s report|
|00001740| 20 75 73 65 73 20 74 68 | 65 20 70 68 72 61 73 65 | uses th|e phrase|
|00001750| 20 60 60 6d 61 79 20 72 | 65 70 6f 72 74 20 61 20 | ``may r|eport a |
|00001760| 76 69 6f 6c 61 74 69 6f | 6e 20 6f 66 20 61 6e 0a |violatio|n of an.|
|00001770| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 20 72 |implemen|tation r|
|00001780| 65 73 74 72 69 63 74 69 | 6f 6e 27 27 20 74 6f 20 |estricti|on'' to |
|00001790| 69 6e 64 69 63 61 74 65 | 20 63 69 72 63 75 6d 73 |indicate| circums|
|000017a0| 74 61 6e 63 65 73 20 75 | 6e 64 65 72 20 77 68 69 |tances u|nder whi|
|000017b0| 63 68 20 61 6e 0a 69 6d | 70 6c 65 6d 65 6e 74 61 |ch an.im|plementa|
|000017c0| 74 69 6f 6e 20 69 73 20 | 70 65 72 6d 69 74 74 65 |tion is |permitte|
|000017d0| 64 20 74 6f 20 72 65 70 | 6f 72 74 20 74 68 61 74 |d to rep|ort that|
|000017e0| 20 69 74 20 69 73 20 75 | 6e 61 62 6c 65 20 74 6f | it is u|nable to|
|000017f0| 20 63 6f 6e 74 69 6e 75 | 65 0a 65 78 65 63 75 74 | continu|e.execut|
|00001800| 69 6f 6e 20 6f 66 20 61 | 20 63 6f 72 72 65 63 74 |ion of a| correct|
|00001810| 20 70 72 6f 67 72 61 6d | 20 62 65 63 61 75 73 65 | program| because|
|00001820| 20 6f 66 20 73 6f 6d 65 | 20 72 65 73 74 72 69 63 | of some| restric|
|00001830| 74 69 6f 6e 20 69 6d 70 | 6f 73 65 64 20 62 79 20 |tion imp|osed by |
|00001840| 74 68 65 0a 69 6d 70 6c | 65 6d 65 6e 74 61 74 69 |the.impl|ementati|
|00001850| 6f 6e 2e 20 20 49 6d 70 | 6c 65 6d 65 6e 74 61 74 |on. Imp|lementat|
|00001860| 69 6f 6e 20 72 65 73 74 | 72 69 63 74 69 6f 6e 73 |ion rest|rictions|
|00001870| 20 61 72 65 20 6f 66 20 | 63 6f 75 72 73 65 20 64 | are of |course d|
|00001880| 69 73 63 6f 75 72 61 67 | 65 64 2c 0a 62 75 74 20 |iscourag|ed,.but |
|00001890| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 73 20 |implemen|tations |
|000018a0| 61 72 65 20 65 6e 63 6f | 75 72 61 67 65 64 20 74 |are enco|uraged t|
|000018b0| 6f 20 72 65 70 6f 72 74 | 20 76 69 6f 6c 61 74 69 |o report| violati|
|000018c0| 6f 6e 73 20 6f 66 20 69 | 6d 70 6c 65 6d 65 6e 74 |ons of i|mplement|
|000018d0| 61 74 69 6f 6e 0a 72 65 | 73 74 72 69 63 74 69 6f |ation.re|strictio|
|000018e0| 6e 73 2e 5c 6d 61 69 6e | 69 6e 64 65 78 7b 69 6d |ns.\main|index{im|
|000018f0| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 72 65 73 |plementa|tion res|
|00001900| 74 72 69 63 74 69 6f 6e | 7d 0a 0a 5c 76 65 73 74 |triction|}..\vest|
|00001910| 20 46 6f 72 20 65 78 61 | 6d 70 6c 65 2c 20 61 6e | For exa|mple, an|
|00001920| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 20 | impleme|ntation |
|00001930| 6d 61 79 20 72 65 70 6f | 72 74 20 61 20 76 69 6f |may repo|rt a vio|
|00001940| 6c 61 74 69 6f 6e 20 6f | 66 20 61 6e 0a 69 6d 70 |lation o|f an.imp|
|00001950| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 20 72 65 73 74 |lementat|ion rest|
|00001960| 72 69 63 74 69 6f 6e 20 | 69 66 20 69 74 20 64 6f |riction |if it do|
|00001970| 65 73 20 6e 6f 74 20 68 | 61 76 65 20 65 6e 6f 75 |es not h|ave enou|
|00001980| 67 68 20 73 74 6f 72 61 | 67 65 20 74 6f 20 72 75 |gh stora|ge to ru|
|00001990| 6e 20 61 0a 70 72 6f 67 | 72 61 6d 2e 0a 0a 5c 76 |n a.prog|ram...\v|
|000019a0| 65 73 74 20 49 66 20 74 | 68 65 20 76 61 6c 75 65 |est If t|he value|
|000019b0| 20 6f 66 20 61 6e 20 65 | 78 70 72 65 73 73 69 6f | of an e|xpressio|
|000019c0| 6e 20 69 73 20 73 61 69 | 64 20 74 6f 20 62 65 20 |n is sai|d to be |
|000019d0| 60 60 75 6e 73 70 65 63 | 69 66 69 65 64 2c 27 27 |``unspec|ified,''|
|000019e0| 20 74 68 65 6e 0a 74 68 | 65 20 65 78 70 72 65 73 | then.th|e expres|
|000019f0| 73 69 6f 6e 20 6d 75 73 | 74 20 65 76 61 6c 75 61 |sion mus|t evalua|
|00001a00| 74 65 20 74 6f 20 73 6f | 6d 65 20 6f 62 6a 65 63 |te to so|me objec|
|00001a10| 74 20 77 69 74 68 6f 75 | 74 20 73 69 67 6e 61 6c |t withou|t signal|
|00001a20| 6c 69 6e 67 20 61 6e 20 | 65 72 72 6f 72 2c 0a 62 |ling an |error,.b|
|00001a30| 75 74 20 74 68 65 20 76 | 61 6c 75 65 20 64 65 70 |ut the v|alue dep|
|00001a40| 65 6e 64 73 20 6f 6e 20 | 74 68 65 20 69 6d 70 6c |ends on |the impl|
|00001a50| 65 6d 65 6e 74 61 74 69 | 6f 6e 3b 20 74 68 69 73 |ementati|on; this|
|00001a60| 20 72 65 70 6f 72 74 20 | 65 78 70 6c 69 63 69 74 | report |explicit|
|00001a70| 6c 79 20 64 6f 65 73 0a | 6e 6f 74 20 73 61 79 20 |ly does.|not say |
|00001a80| 77 68 61 74 20 76 61 6c | 75 65 20 73 68 6f 75 6c |what val|ue shoul|
|00001a90| 64 20 62 65 20 72 65 74 | 75 72 6e 65 64 2e 20 5c |d be ret|urned. \|
|00001aa0| 6d 61 69 6e 69 6e 64 65 | 78 7b 75 6e 73 70 65 63 |maininde|x{unspec|
|00001ab0| 69 66 69 65 64 7d 0a 0a | 5c 74 6f 64 6f 7b 54 61 |ified}..|\todo{Ta|
|00001ac0| 6c 6b 20 61 62 6f 75 74 | 20 75 6e 73 70 65 63 69 |lk about| unspeci|
|00001ad0| 66 69 65 64 20 62 65 68 | 61 76 69 6f 72 20 76 73 |fied beh|avior vs|
|00001ae0| 2e 20 75 6e 73 70 65 63 | 69 66 69 65 64 20 76 61 |. unspec|ified va|
|00001af0| 6c 75 65 73 2e 7d 0a 0a | 5c 74 6f 64 6f 7b 4c 6f |lues.}..|\todo{Lo|
|00001b00| 6f 6b 20 61 74 20 4b 4d | 50 27 73 20 73 69 74 75 |ok at KM|P's situ|
|00001b10| 61 74 69 6f 6e 73 20 70 | 61 70 65 72 2e 7d 0a 0a |ations p|aper.}..|
|00001b20| 0a 5c 73 75 62 73 65 63 | 74 69 6f 6e 7b 45 6e 74 |.\subsec|tion{Ent|
|00001b30| 72 79 20 66 6f 72 6d 61 | 74 7d 0a 0a 43 68 61 70 |ry forma|t}..Chap|
|00001b40| 74 65 72 73 7e 5c 72 65 | 66 7b 65 78 70 72 65 73 |ters~\re|f{expres|
|00001b50| 73 69 6f 6e 63 68 61 70 | 74 65 72 7d 20 61 6e 64 |sionchap|ter} and|
|00001b60| 7e 5c 72 65 66 7b 62 75 | 69 6c 74 69 6e 63 68 61 |~\ref{bu|iltincha|
|00001b70| 70 74 65 72 7d 20 61 72 | 65 20 6f 72 67 61 6e 69 |pter} ar|e organi|
|00001b80| 7a 65 64 0a 69 6e 74 6f | 20 65 6e 74 72 69 65 73 |zed.into| entries|
|00001b90| 2e 20 20 45 61 63 68 20 | 65 6e 74 72 79 20 64 65 |. Each |entry de|
|00001ba0| 73 63 72 69 62 65 73 20 | 6f 6e 65 20 6c 61 6e 67 |scribes |one lang|
|00001bb0| 75 61 67 65 20 66 65 61 | 74 75 72 65 20 6f 72 20 |uage fea|ture or |
|00001bc0| 61 20 67 72 6f 75 70 20 | 6f 66 0a 72 65 6c 61 74 |a group |of.relat|
|00001bd0| 65 64 20 66 65 61 74 75 | 72 65 73 2c 20 77 68 65 |ed featu|res, whe|
|00001be0| 72 65 20 61 20 66 65 61 | 74 75 72 65 20 69 73 20 |re a fea|ture is |
|00001bf0| 65 69 74 68 65 72 20 61 | 20 73 79 6e 74 61 63 74 |either a| syntact|
|00001c00| 69 63 20 63 6f 6e 73 74 | 72 75 63 74 20 6f 72 20 |ic const|ruct or |
|00001c10| 61 0a 62 75 69 6c 74 2d | 69 6e 20 70 72 6f 63 65 |a.built-|in proce|
|00001c20| 64 75 72 65 2e 20 20 41 | 6e 20 65 6e 74 72 79 20 |dure. A|n entry |
|00001c30| 62 65 67 69 6e 73 20 77 | 69 74 68 20 6f 6e 65 20 |begins w|ith one |
|00001c40| 6f 72 20 6d 6f 72 65 20 | 68 65 61 64 65 72 20 6c |or more |header l|
|00001c50| 69 6e 65 73 20 6f 66 20 | 74 68 65 20 66 6f 72 6d |ines of |the form|
|00001c60| 0a 0a 5c 6e 6f 69 6e 64 | 65 6e 74 5c 70 70 72 6f |..\noind|ent\ppro|
|00001c70| 74 6f 7b 5c 76 61 72 7b | 74 65 6d 70 6c 61 74 65 |to{\var{|template|
|00001c80| 7d 7d 7b 65 73 73 65 6e | 74 69 61 6c 20 5c 76 61 |}}{essen|tial \va|
|00001c90| 72 7b 63 61 74 65 67 6f | 72 79 7d 7d 5c 75 6e 70 |r{catego|ry}}\unp|
|00001ca0| 65 6e 61 6c 74 79 0a 0a | 69 66 20 74 68 65 20 66 |enalty..|if the f|
|00001cb0| 65 61 74 75 72 65 20 69 | 73 20 61 6e 20 65 73 73 |eature i|s an ess|
|00001cc0| 65 6e 74 69 61 6c 20 66 | 65 61 74 75 72 65 2c 20 |ential f|eature, |
|00001cd0| 6f 72 20 73 69 6d 70 6c | 79 0a 0a 5c 6e 6f 69 6e |or simpl|y..\noin|
|00001ce0| 64 65 6e 74 5c 70 70 72 | 6f 74 6f 7b 5c 76 61 72 |dent\ppr|oto{\var|
|00001cf0| 7b 74 65 6d 70 6c 61 74 | 65 7d 7d 7b 5c 76 61 72 |{templat|e}}{\var|
|00001d00| 7b 63 61 74 65 67 6f 72 | 79 7d 7d 5c 75 6e 70 65 |{categor|y}}\unpe|
|00001d10| 6e 61 6c 74 79 0a 0a 69 | 66 20 74 68 65 20 66 65 |nalty..i|f the fe|
|00001d20| 61 74 75 72 65 20 69 73 | 20 6e 6f 74 20 61 6e 20 |ature is| not an |
|00001d30| 65 73 73 65 6e 74 69 61 | 6c 20 66 65 61 74 75 72 |essentia|l featur|
|00001d40| 65 2e 0a 0a 49 66 20 5c | 76 61 72 7b 63 61 74 65 |e...If \|var{cate|
|00001d50| 67 6f 72 79 7d 20 69 73 | 20 60 60 5c 65 78 70 72 |gory} is| ``\expr|
|00001d60| 74 79 70 65 27 27 2c 20 | 74 68 65 20 65 6e 74 72 |type'', |the entr|
|00001d70| 79 20 64 65 73 63 72 69 | 62 65 73 20 61 6e 20 65 |y descri|bes an e|
|00001d80| 78 70 72 65 73 73 69 6f | 6e 0a 74 79 70 65 2c 20 |xpressio|n.type, |
|00001d90| 61 6e 64 20 74 68 65 20 | 68 65 61 64 65 72 20 6c |and the |header l|
|00001da0| 69 6e 65 20 67 69 76 65 | 73 20 74 68 65 20 73 79 |ine give|s the sy|
|00001db0| 6e 74 61 78 20 6f 66 20 | 74 68 65 20 65 78 70 72 |ntax of |the expr|
|00001dc0| 65 73 73 69 6f 6e 20 74 | 79 70 65 2e 0a 43 6f 6d |ession t|ype..Com|
|00001dd0| 70 6f 6e 65 6e 74 73 20 | 6f 66 20 65 78 70 72 65 |ponents |of expre|
|00001de0| 73 73 69 6f 6e 73 20 61 | 72 65 20 64 65 73 69 67 |ssions a|re desig|
|00001df0| 6e 61 74 65 64 20 62 79 | 20 73 79 6e 74 61 63 74 |nated by| syntact|
|00001e00| 69 63 20 76 61 72 69 61 | 62 6c 65 73 2c 20 77 68 |ic varia|bles, wh|
|00001e10| 69 63 68 0a 61 72 65 20 | 77 72 69 74 74 65 6e 20 |ich.are |written |
|00001e20| 75 73 69 6e 67 20 61 6e | 67 6c 65 20 62 72 61 63 |using an|gle brac|
|00001e30| 6b 65 74 73 2c 20 66 6f | 72 20 65 78 61 6d 70 6c |kets, fo|r exampl|
|00001e40| 65 2c 20 5c 68 79 70 65 | 72 7b 65 78 70 72 65 73 |e, \hype|r{expres|
|00001e50| 73 69 6f 6e 7d 2c 0a 5c | 68 79 70 65 72 7b 76 61 |sion},.\|hyper{va|
|00001e60| 72 69 61 62 6c 65 7d 2e | 20 20 53 79 6e 74 61 63 |riable}.| Syntac|
|00001e70| 74 69 63 20 76 61 72 69 | 61 62 6c 65 73 20 73 68 |tic vari|ables sh|
|00001e80| 6f 75 6c 64 20 62 65 20 | 75 6e 64 65 72 73 74 6f |ould be |understo|
|00001e90| 6f 64 20 74 6f 20 64 65 | 6e 6f 74 65 20 73 65 67 |od to de|note seg|
|00001ea0| 6d 65 6e 74 73 20 6f 66 | 0a 70 72 6f 67 72 61 6d |ments of|.program|
|00001eb0| 20 74 65 78 74 3b 20 66 | 6f 72 20 65 78 61 6d 70 | text; f|or examp|
|00001ec0| 6c 65 2c 20 5c 68 79 70 | 65 72 7b 65 78 70 72 65 |le, \hyp|er{expre|
|00001ed0| 73 73 69 6f 6e 7d 20 73 | 74 61 6e 64 73 20 66 6f |ssion} s|tands fo|
|00001ee0| 72 20 61 6e 79 20 73 74 | 72 69 6e 67 20 6f 66 0a |r any st|ring of.|
|00001ef0| 63 68 61 72 61 63 74 65 | 72 73 20 77 68 69 63 68 |characte|rs which|
|00001f00| 20 69 73 20 61 20 73 79 | 6e 74 61 63 74 69 63 61 | is a sy|ntactica|
|00001f10| 6c 6c 79 20 76 61 6c 69 | 64 20 65 78 70 72 65 73 |lly vali|d expres|
|00001f20| 73 69 6f 6e 2e 20 20 54 | 68 65 20 6e 6f 74 61 74 |sion. T|he notat|
|00001f30| 69 6f 6e 0a 5c 62 65 67 | 69 6e 7b 74 61 62 62 69 |ion.\beg|in{tabbi|
|00001f40| 6e 67 7d 0a 5c 71 71 75 | 61 64 20 5c 68 79 70 65 |ng}.\qqu|ad \hype|
|00001f50| 72 69 7b 74 68 69 6e 67 | 7d 20 24 5c 6c 64 6f 74 |ri{thing|} $\ldot|
|00001f60| 73 24 0a 5c 65 6e 64 7b | 74 61 62 62 69 6e 67 7d |s$.\end{|tabbing}|
|00001f70| 0a 69 6e 64 69 63 61 74 | 65 73 20 7a 65 72 6f 20 |.indicat|es zero |
|00001f80| 6f 72 20 6d 6f 72 65 20 | 6f 63 63 75 72 72 65 6e |or more |occurren|
|00001f90| 63 65 73 20 6f 66 20 61 | 20 5c 68 79 70 65 72 7b |ces of a| \hyper{|
|00001fa0| 74 68 69 6e 67 7d 2c 20 | 61 6e 64 0a 5c 62 65 67 |thing}, |and.\beg|
|00001fb0| 69 6e 7b 74 61 62 62 69 | 6e 67 7d 0a 5c 71 71 75 |in{tabbi|ng}.\qqu|
|00001fc0| 61 64 20 5c 68 79 70 65 | 72 69 7b 74 68 69 6e 67 |ad \hype|ri{thing|
|00001fd0| 7d 20 5c 68 79 70 65 72 | 69 69 7b 74 68 69 6e 67 |} \hyper|ii{thing|
|00001fe0| 7d 20 24 5c 6c 64 6f 74 | 73 24 0a 5c 65 6e 64 7b |} $\ldot|s$.\end{|
|00001ff0| 74 61 62 62 69 6e 67 7d | 0a 69 6e 64 69 63 61 74 |tabbing}|.indicat|
|00002000| 65 73 20 6f 6e 65 20 6f | 72 20 6d 6f 72 65 20 6f |es one o|r more o|
|00002010| 63 63 75 72 72 65 6e 63 | 65 73 20 6f 66 20 61 20 |ccurrenc|es of a |
|00002020| 5c 68 79 70 65 72 7b 74 | 68 69 6e 67 7d 2e 0a 0a |\hyper{t|hing}...|
|00002030| 49 66 20 5c 76 61 72 7b | 63 61 74 65 67 6f 72 79 |If \var{|category|
|00002040| 7d 20 69 73 20 60 60 70 | 72 6f 63 65 64 75 72 65 |} is ``p|rocedure|
|00002050| 27 27 2c 20 74 68 65 6e | 20 74 68 65 20 65 6e 74 |'', then| the ent|
|00002060| 72 79 20 64 65 73 63 72 | 69 62 65 73 20 61 20 70 |ry descr|ibes a p|
|00002070| 72 6f 63 65 64 75 72 65 | 2c 20 61 6e 64 0a 74 68 |rocedure|, and.th|
|00002080| 65 20 68 65 61 64 65 72 | 20 6c 69 6e 65 20 67 69 |e header| line gi|
|00002090| 76 65 73 20 61 20 74 65 | 6d 70 6c 61 74 65 20 66 |ves a te|mplate f|
|000020a0| 6f 72 20 61 20 63 61 6c | 6c 20 74 6f 20 74 68 65 |or a cal|l to the|
|000020b0| 20 70 72 6f 63 65 64 75 | 72 65 2e 20 20 41 72 67 | procedu|re. Arg|
|000020c0| 75 6d 65 6e 74 0a 6e 61 | 6d 65 73 20 69 6e 20 74 |ument.na|mes in t|
|000020d0| 68 65 20 74 65 6d 70 6c | 61 74 65 20 61 72 65 20 |he templ|ate are |
|000020e0| 5c 76 61 72 7b 69 74 61 | 6c 69 63 69 7a 65 64 7d |\var{ita|licized}|
|000020f0| 2e 20 20 54 68 75 73 20 | 74 68 65 20 68 65 61 64 |. Thus |the head|
|00002100| 65 72 20 6c 69 6e 65 0a | 0a 5c 6e 6f 69 6e 64 65 |er line.|.\noinde|
|00002110| 6e 74 5c 70 70 72 6f 74 | 6f 7b 28 76 65 63 74 6f |nt\pprot|o{(vecto|
|00002120| 72 2d 72 65 66 20 5c 76 | 61 72 7b 76 65 63 74 6f |r-ref \v|ar{vecto|
|00002130| 72 7d 20 5c 76 61 72 7b | 6b 7d 29 7d 7b 65 73 73 |r} \var{|k})}{ess|
|00002140| 65 6e 74 69 61 6c 20 70 | 72 6f 63 65 64 75 72 65 |ential p|rocedure|
|00002150| 7d 5c 75 6e 70 65 6e 61 | 6c 74 79 0a 0a 69 6e 64 |}\unpena|lty..ind|
|00002160| 69 63 61 74 65 73 20 74 | 68 61 74 20 74 68 65 20 |icates t|hat the |
|00002170| 65 73 73 65 6e 74 69 61 | 6c 20 62 75 69 6c 74 2d |essentia|l built-|
|00002180| 69 6e 20 70 72 6f 63 65 | 64 75 72 65 20 7b 5c 74 |in proce|dure {\t|
|00002190| 74 20 76 65 63 74 6f 72 | 2d 72 65 66 7d 20 74 61 |t vector|-ref} ta|
|000021a0| 6b 65 73 0a 74 77 6f 20 | 61 72 67 75 6d 65 6e 74 |kes.two |argument|
|000021b0| 73 2c 20 61 20 76 65 63 | 74 6f 72 20 5c 76 61 72 |s, a vec|tor \var|
|000021c0| 7b 76 65 63 74 6f 72 7d | 20 61 6e 64 20 61 6e 20 |{vector}| and an |
|000021d0| 65 78 61 63 74 20 6e 6f | 6e 2d 6e 65 67 61 74 69 |exact no|n-negati|
|000021e0| 76 65 20 69 6e 74 65 67 | 65 72 0a 5c 76 61 72 7b |ve integ|er.\var{|
|000021f0| 6b 7d 20 28 73 65 65 20 | 62 65 6c 6f 77 29 2e 20 |k} (see |below). |
|00002200| 20 54 68 65 20 68 65 61 | 64 65 72 20 6c 69 6e 65 | The hea|der line|
|00002210| 73 0a 0a 5c 6e 6f 69 6e | 64 65 6e 74 25 0a 5c 70 |s..\noin|dent%.\p|
|00002220| 70 72 6f 74 6f 7b 28 6d | 61 6b 65 2d 76 65 63 74 |proto{(m|ake-vect|
|00002230| 6f 72 20 5c 76 61 72 7b | 6b 7d 29 7d 7b 65 73 73 |or \var{|k})}{ess|
|00002240| 65 6e 74 69 61 6c 20 70 | 72 6f 63 65 64 75 72 65 |ential p|rocedure|
|00002250| 7d 0a 5c 70 70 72 6f 74 | 6f 7b 28 6d 61 6b 65 2d |}.\pprot|o{(make-|
|00002260| 76 65 63 74 6f 72 20 5c | 76 61 72 7b 6b 7d 20 5c |vector \|var{k} \|
|00002270| 76 61 72 7b 66 69 6c 6c | 7d 29 7d 7b 70 72 6f 63 |var{fill|})}{proc|
|00002280| 65 64 75 72 65 7d 5c 75 | 6e 70 65 6e 61 6c 74 79 |edure}\u|npenalty|
|00002290| 0a 0a 69 6e 64 69 63 61 | 74 65 20 74 68 61 74 20 |..indica|te that |
|000022a0| 69 6e 20 61 6c 6c 20 69 | 6d 70 6c 65 6d 65 6e 74 |in all i|mplement|
|000022b0| 61 74 69 6f 6e 73 2c 20 | 74 68 65 20 7b 5c 74 74 |ations, |the {\tt|
|000022c0| 20 6d 61 6b 65 2d 76 65 | 63 74 6f 72 7d 20 70 72 | make-ve|ctor} pr|
|000022d0| 6f 63 65 64 75 72 65 0a | 6d 75 73 74 20 62 65 20 |ocedure.|must be |
|000022e0| 64 65 66 69 6e 65 64 20 | 74 6f 20 74 61 6b 65 20 |defined |to take |
|000022f0| 6f 6e 65 20 61 72 67 75 | 6d 65 6e 74 2c 20 61 6e |one argu|ment, an|
|00002300| 64 20 73 6f 6d 65 20 69 | 6d 70 6c 65 6d 65 6e 74 |d some i|mplement|
|00002310| 61 74 69 6f 6e 73 20 77 | 69 6c 6c 0a 65 78 74 65 |ations w|ill.exte|
|00002320| 6e 64 20 69 74 20 74 6f | 20 74 61 6b 65 20 74 77 |nd it to| take tw|
|00002330| 6f 20 61 72 67 75 6d 65 | 6e 74 73 2e 0a 0a 5c 6c |o argume|nts...\l|
|00002340| 61 62 65 6c 7b 74 79 70 | 65 63 6f 6e 76 65 6e 74 |abel{typ|econvent|
|00002350| 69 6f 6e 73 7d 0a 49 74 | 20 69 73 20 61 6e 20 65 |ions}.It| is an e|
|00002360| 72 72 6f 72 20 66 6f 72 | 20 61 6e 20 6f 70 65 72 |rror for| an oper|
|00002370| 61 74 69 6f 6e 20 74 6f | 20 62 65 20 70 72 65 73 |ation to| be pres|
|00002380| 65 6e 74 65 64 20 77 69 | 74 68 20 61 6e 20 61 72 |ented wi|th an ar|
|00002390| 67 75 6d 65 6e 74 20 74 | 68 61 74 20 69 74 0a 69 |gument t|hat it.i|
|000023a0| 73 20 6e 6f 74 20 73 70 | 65 63 69 66 69 65 64 20 |s not sp|ecified |
|000023b0| 74 6f 20 68 61 6e 64 6c | 65 2e 20 20 46 6f 72 20 |to handl|e. For |
|000023c0| 73 75 63 63 69 6e 63 74 | 6e 65 73 73 2c 20 77 65 |succinct|ness, we|
|000023d0| 20 66 6f 6c 6c 6f 77 20 | 74 68 65 20 63 6f 6e 76 | follow |the conv|
|000023e0| 65 6e 74 69 6f 6e 0a 74 | 68 61 74 20 69 66 20 61 |ention.t|hat if a|
|000023f0| 6e 20 61 72 67 75 6d 65 | 6e 74 20 6e 61 6d 65 20 |n argume|nt name |
|00002400| 69 73 20 61 6c 73 6f 20 | 74 68 65 20 6e 61 6d 65 |is also |the name|
|00002410| 20 6f 66 20 61 20 74 79 | 70 65 20 6c 69 73 74 65 | of a ty|pe liste|
|00002420| 64 20 69 6e 0a 73 65 63 | 74 69 6f 6e 7e 5c 72 65 |d in.sec|tion~\re|
|00002430| 66 7b 64 69 73 6a 6f 69 | 6e 74 6e 65 73 73 7d 2c |f{disjoi|ntness},|
|00002440| 20 74 68 65 6e 20 74 68 | 61 74 20 61 72 67 75 6d | then th|at argum|
|00002450| 65 6e 74 20 6d 75 73 74 | 20 62 65 20 6f 66 20 74 |ent must| be of t|
|00002460| 68 65 20 6e 61 6d 65 64 | 20 74 79 70 65 2e 0a 46 |he named| type..F|
|00002470| 6f 72 20 65 78 61 6d 70 | 6c 65 2c 20 74 68 65 20 |or examp|le, the |
|00002480| 68 65 61 64 65 72 20 6c | 69 6e 65 20 66 6f 72 20 |header l|ine for |
|00002490| 7b 5c 74 74 20 76 65 63 | 74 6f 72 2d 72 65 66 7d |{\tt vec|tor-ref}|
|000024a0| 20 67 69 76 65 6e 20 61 | 62 6f 76 65 20 64 69 63 | given a|bove dic|
|000024b0| 74 61 74 65 73 20 74 68 | 61 74 20 74 68 65 0a 66 |tates th|at the.f|
|000024c0| 69 72 73 74 20 61 72 67 | 75 6d 65 6e 74 20 74 6f |irst arg|ument to|
|000024d0| 20 7b 5c 74 74 20 76 65 | 63 74 6f 72 2d 72 65 66 | {\tt ve|ctor-ref|
|000024e0| 7d 20 6d 75 73 74 20 62 | 65 20 61 20 76 65 63 74 |} must b|e a vect|
|000024f0| 6f 72 2e 20 20 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |or. The| followi|
|00002500| 6e 67 20 6e 61 6d 69 6e | 67 0a 63 6f 6e 76 65 6e |ng namin|g.conven|
|00002510| 74 69 6f 6e 73 20 61 6c | 73 6f 20 69 6d 70 6c 79 |tions al|so imply|
|00002520| 20 74 79 70 65 20 72 65 | 73 74 72 69 63 74 69 6f | type re|strictio|
|00002530| 6e 73 3a 0a 5c 6e 65 77 | 63 6f 6d 6d 61 6e 64 7b |ns:.\new|command{|
|00002540| 5c 66 6f 6f 7d 5b 31 5d | 7b 5c 76 72 7b 23 31 7d |\foo}[1]|{\vr{#1}|
|00002550| 2c 20 5c 76 72 69 7b 23 | 31 7d 2c 20 24 5c 6c 64 |, \vri{#|1}, $\ld|
|00002560| 6f 74 73 24 20 5c 76 72 | 6a 7b 23 31 7d 2c 20 24 |ots$ \vr|j{#1}, $|
|00002570| 5c 6c 64 6f 74 73 24 7d | 0a 24 24 0a 5c 62 65 67 |\ldots$}|.$$.\beg|
|00002580| 69 6e 7b 74 61 62 75 6c | 61 72 7d 7b 6c 6c 7d 0a |in{tabul|ar}{ll}.|
|00002590| 5c 76 61 72 7b 6f 62 6a | 7d 26 61 6e 79 20 6f 62 |\var{obj|}&any ob|
|000025a0| 6a 65 63 74 5c 5c 0a 5c | 66 6f 6f 7b 6c 69 73 74 |ject\\.\|foo{list|
|000025b0| 7d 26 6c 69 73 74 20 28 | 73 65 65 20 73 65 63 74 |}&list (|see sect|
|000025c0| 69 6f 6e 7e 5c 72 65 66 | 7b 6c 69 73 74 73 65 63 |ion~\ref|{listsec|
|000025d0| 74 69 6f 6e 7d 29 5c 5c | 0a 5c 66 6f 6f 7b 7a 7d |tion})\\|.\foo{z}|
|000025e0| 26 63 6f 6d 70 6c 65 78 | 20 6e 75 6d 62 65 72 5c |&complex| number\|
|000025f0| 5c 0a 5c 66 6f 6f 7b 78 | 7d 26 72 65 61 6c 20 6e |\.\foo{x|}&real n|
|00002600| 75 6d 62 65 72 5c 5c 0a | 5c 66 6f 6f 7b 79 7d 26 |umber\\.|\foo{y}&|
|00002610| 72 65 61 6c 20 6e 75 6d | 62 65 72 5c 5c 0a 5c 66 |real num|ber\\.\f|
|00002620| 6f 6f 7b 71 7d 26 72 61 | 74 69 6f 6e 61 6c 20 6e |oo{q}&ra|tional n|
|00002630| 75 6d 62 65 72 5c 5c 0a | 5c 66 6f 6f 7b 6e 7d 26 |umber\\.|\foo{n}&|
|00002640| 69 6e 74 65 67 65 72 5c | 5c 0a 5c 66 6f 6f 7b 6b |integer\|\.\foo{k|
|00002650| 7d 26 65 78 61 63 74 20 | 6e 6f 6e 2d 6e 65 67 61 |}&exact |non-nega|
|00002660| 74 69 76 65 20 69 6e 74 | 65 67 65 72 5c 5c 0a 5c |tive int|eger\\.\|
|00002670| 65 6e 64 7b 74 61 62 75 | 6c 61 72 7d 0a 24 24 0a |end{tabu|lar}.$$.|
|00002680| 0a 5c 74 6f 64 6f 7b 50 | 72 6f 76 69 64 65 20 61 |.\todo{P|rovide a|
|00002690| 6e 20 65 78 61 6d 70 6c | 65 20 65 6e 74 72 79 3f |n exampl|e entry?|
|000026a0| 3f 7d 0a 0a 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |?}...\su|bsection|
|000026b0| 7b 45 76 61 6c 75 61 74 | 69 6f 6e 20 65 78 61 6d |{Evaluat|ion exam|
|000026c0| 70 6c 65 73 7d 0a 0a 54 | 68 65 20 73 79 6d 62 6f |ples}..T|he symbo|
|000026d0| 6c 20 60 60 5c 65 76 61 | 6c 73 74 6f 27 27 20 75 |l ``\eva|lsto'' u|
|000026e0| 73 65 64 20 69 6e 20 70 | 72 6f 67 72 61 6d 20 65 |sed in p|rogram e|
|000026f0| 78 61 6d 70 6c 65 73 20 | 73 68 6f 75 6c 64 20 62 |xamples |should b|
|00002700| 65 20 72 65 61 64 0a 60 | 60 65 76 61 6c 75 61 74 |e read.`|`evaluat|
|00002710| 65 73 20 74 6f 2e 27 27 | 20 20 46 6f 72 20 65 78 |es to.''| For ex|
|00002720| 61 6d 70 6c 65 2c 0a 0a | 5c 62 65 67 69 6e 7b 73 |ample,..|\begin{s|
|00002730| 63 68 65 6d 65 7d 0a 28 | 2a 20 35 20 38 29 20 20 |cheme}.(|* 5 8) |
|00002740| 20 20 20 20 5c 65 76 20 | 20 34 30 25 0a 5c 65 6e | \ev | 40%.\en|
|00002750| 64 7b 73 63 68 65 6d 65 | 7d 0a 0a 6d 65 61 6e 73 |d{scheme|}..means|
|00002760| 20 74 68 61 74 20 74 68 | 65 20 65 78 70 72 65 73 | that th|e expres|
|00002770| 73 69 6f 6e 20 7b 5c 74 | 74 28 2a 20 35 20 38 29 |sion {\t|t(* 5 8)|
|00002780| 7d 20 65 76 61 6c 75 61 | 74 65 73 20 74 6f 20 74 |} evalua|tes to t|
|00002790| 68 65 20 6f 62 6a 65 63 | 74 20 7b 5c 74 74 20 34 |he objec|t {\tt 4|
|000027a0| 30 7d 2e 0a 4f 72 2c 20 | 6d 6f 72 65 20 70 72 65 |0}..Or, |more pre|
|000027b0| 63 69 73 65 6c 79 3a 20 | 20 74 68 65 20 65 78 70 |cisely: | the exp|
|000027c0| 72 65 73 73 69 6f 6e 20 | 67 69 76 65 6e 20 62 79 |ression |given by|
|000027d0| 20 74 68 65 20 73 65 71 | 75 65 6e 63 65 20 6f 66 | the seq|uence of|
|000027e0| 20 63 68 61 72 61 63 74 | 65 72 73 0a 60 60 7b 5c | charact|ers.``{\|
|000027f0| 74 74 28 2a 20 35 20 38 | 29 7d 27 27 20 65 76 61 |tt(* 5 8|)}'' eva|
|00002800| 6c 75 61 74 65 73 2c 20 | 69 6e 20 74 68 65 20 69 |luates, |in the i|
|00002810| 6e 69 74 69 61 6c 20 65 | 6e 76 69 72 6f 6e 6d 65 |nitial e|nvironme|
|00002820| 6e 74 2c 20 74 6f 20 61 | 6e 20 6f 62 6a 65 63 74 |nt, to a|n object|
|00002830| 0a 74 68 61 74 20 6d 61 | 79 20 62 65 20 72 65 70 |.that ma|y be rep|
|00002840| 72 65 73 65 6e 74 65 64 | 20 65 78 74 65 72 6e 61 |resented| externa|
|00002850| 6c 6c 79 20 62 79 20 74 | 68 65 20 73 65 71 75 65 |lly by t|he seque|
|00002860| 6e 63 65 20 6f 66 20 63 | 68 61 72 61 63 74 65 72 |nce of c|haracter|
|00002870| 73 20 60 60 7b 5c 74 74 | 0a 34 30 7d 27 27 2e 20 |s ``{\tt|.40}''. |
|00002880| 20 53 65 65 20 73 65 63 | 74 69 6f 6e 7e 5c 72 65 | See sec|tion~\re|
|00002890| 66 7b 65 78 74 65 72 6e | 61 6c 72 65 70 73 7d 20 |f{extern|alreps} |
|000028a0| 66 6f 72 20 61 20 64 69 | 73 63 75 73 73 69 6f 6e |for a di|scussion|
|000028b0| 20 6f 66 20 65 78 74 65 | 72 6e 61 6c 0a 72 65 70 | of exte|rnal.rep|
|000028c0| 72 65 73 65 6e 74 61 74 | 69 6f 6e 73 20 6f 66 20 |resentat|ions of |
|000028d0| 6f 62 6a 65 63 74 73 2e | 0a 0a 5c 73 75 62 73 65 |objects.|..\subse|
|000028e0| 63 74 69 6f 6e 7b 4e 61 | 6d 69 6e 67 20 63 6f 6e |ction{Na|ming con|
|000028f0| 76 65 6e 74 69 6f 6e 73 | 7d 0a 0a 42 79 20 63 6f |ventions|}..By co|
|00002900| 6e 76 65 6e 74 69 6f 6e | 2c 20 74 68 65 20 6e 61 |nvention|, the na|
|00002910| 6d 65 73 20 6f 66 20 70 | 72 6f 63 65 64 75 72 65 |mes of p|rocedure|
|00002920| 73 20 74 68 61 74 20 61 | 6c 77 61 79 73 20 72 65 |s that a|lways re|
|00002930| 74 75 72 6e 20 61 20 62 | 6f 6f 6c 65 61 6e 0a 76 |turn a b|oolean.v|
|00002940| 61 6c 75 65 20 75 73 75 | 61 6c 6c 79 20 65 6e 64 |alue usu|ally end|
|00002950| 0a 69 6e 20 60 60 5c 69 | 64 65 7b 3f 7d 27 27 2e |.in ``\i|de{?}''.|
|00002960| 20 20 53 75 63 68 20 70 | 72 6f 63 65 64 75 72 65 | Such p|rocedure|
|00002970| 73 20 61 72 65 20 63 61 | 6c 6c 65 64 20 70 72 65 |s are ca|lled pre|
|00002980| 64 69 63 61 74 65 73 2e | 5c 73 63 68 69 6e 64 65 |dicates.|\schinde|
|00002990| 78 7b 3f 7d 0a 0a 42 79 | 20 63 6f 6e 76 65 6e 74 |x{?}..By| convent|
|000029a0| 69 6f 6e 2c 20 74 68 65 | 20 6e 61 6d 65 73 20 6f |ion, the| names o|
|000029b0| 66 20 70 72 6f 63 65 64 | 75 72 65 73 20 74 68 61 |f proced|ures tha|
|000029c0| 74 20 73 74 6f 72 65 20 | 76 61 6c 75 65 73 20 69 |t store |values i|
|000029d0| 6e 74 6f 20 70 72 65 76 | 69 6f 75 73 6c 79 0a 61 |nto prev|iously.a|
|000029e0| 6c 6c 6f 63 61 74 65 64 | 20 6c 6f 63 61 74 69 6f |llocated| locatio|
|000029f0| 6e 73 20 28 73 65 65 20 | 73 65 63 74 69 6f 6e 7e |ns (see |section~|
|00002a00| 5c 72 65 66 7b 73 74 6f | 72 61 67 65 6d 6f 64 65 |\ref{sto|ragemode|
|00002a10| 6c 7d 29 20 75 73 75 61 | 6c 6c 79 20 65 6e 64 20 |l}) usua|lly end |
|00002a20| 69 6e 0a 60 60 5c 69 64 | 65 7b 21 7d 27 27 2e 0a |in.``\id|e{!}''..|
|00002a30| 53 75 63 68 20 70 72 6f | 63 65 64 75 72 65 73 20 |Such pro|cedures |
|00002a40| 61 72 65 20 63 61 6c 6c | 65 64 20 6d 75 74 61 74 |are call|ed mutat|
|00002a50| 69 6f 6e 20 70 72 6f 63 | 65 64 75 72 65 73 2e 0a |ion proc|edures..|
|00002a60| 42 79 20 63 6f 6e 76 65 | 6e 74 69 6f 6e 2c 20 74 |By conve|ntion, t|
|00002a70| 68 65 20 76 61 6c 75 65 | 20 72 65 74 75 72 6e 65 |he value| returne|
|00002a80| 64 20 62 79 20 61 20 6d | 75 74 61 74 69 6f 6e 20 |d by a m|utation |
|00002a90| 70 72 6f 63 65 64 75 72 | 65 20 69 73 20 75 6e 73 |procedur|e is uns|
|00002aa0| 70 65 63 69 66 69 65 64 | 2e 0a 5c 73 63 68 69 6e |pecified|..\schin|
|00002ab0| 64 65 78 7b 21 7d 0a 0a | 42 79 20 63 6f 6e 76 65 |dex{!}..|By conve|
|00002ac0| 6e 74 69 6f 6e 2c 20 60 | 60 5c 69 64 65 7b 2d 3e |ntion, `|`\ide{->|
|00002ad0| 7d 27 27 20 61 70 70 65 | 61 72 73 20 77 69 74 68 |}'' appe|ars with|
|00002ae0| 69 6e 20 74 68 65 20 6e | 61 6d 65 73 20 6f 66 20 |in the n|ames of |
|00002af0| 70 72 6f 63 65 64 75 72 | 65 73 20 74 68 61 74 0a |procedur|es that.|
|00002b00| 74 61 6b 65 20 61 6e 20 | 6f 62 6a 65 63 74 20 6f |take an |object o|
|00002b10| 66 20 6f 6e 65 20 74 79 | 70 65 20 61 6e 64 20 72 |f one ty|pe and r|
|00002b20| 65 74 75 72 6e 20 61 6e | 20 61 6e 61 6c 6f 67 6f |eturn an| analogo|
|00002b30| 75 73 20 6f 62 6a 65 63 | 74 20 6f 66 20 61 6e 6f |us objec|t of ano|
|00002b40| 74 68 65 72 20 74 79 70 | 65 2e 0a 46 6f 72 20 65 |ther typ|e..For e|
|00002b50| 78 61 6d 70 6c 65 2c 20 | 5c 69 64 65 7b 6c 69 73 |xample, |\ide{lis|
|00002b60| 74 2d 3e 76 65 63 74 6f | 72 7d 20 74 61 6b 65 73 |t->vecto|r} takes|
|00002b70| 20 61 20 6c 69 73 74 20 | 61 6e 64 20 72 65 74 75 | a list |and retu|
|00002b80| 72 6e 73 20 61 20 76 65 | 63 74 6f 72 20 77 68 6f |rns a ve|ctor who|
|00002b90| 73 65 0a 65 6c 65 6d 65 | 6e 74 73 20 61 72 65 20 |se.eleme|nts are |
|00002ba0| 74 68 65 20 73 61 6d 65 | 20 61 73 20 74 68 6f 73 |the same| as thos|
|00002bb0| 65 20 6f 66 20 74 68 65 | 20 6c 69 73 74 2e 5c 73 |e of the| list.\s|
|00002bc0| 63 68 69 6e 64 65 78 7b | 2d 3e 7d 0a 0a 0a 09 0a |chindex{|->}.....|
|00002bd0| 5c 74 6f 64 6f 7b 54 65 | 72 6d 73 20 74 68 61 74 |\todo{Te|rms that|
|00002be0| 20 6e 65 65 64 20 64 65 | 66 69 6e 69 6e 67 3a 20 | need de|fining: |
|00002bf0| 74 68 75 6e 6b 2c 20 63 | 6f 6d 6d 61 6e 64 20 28 |thunk, c|ommand (|
|00002c00| 77 68 61 74 20 65 6c 73 | 65 3f 29 2e 7d |what els|e?).} |
+--------+-------------------------+-------------------------+--------+--------+