home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / scheme / schmrprt / r399rs.lha / expr.tex < prev    next >
LaTeX Document  |  1989-08-31  |  25.9 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
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 5c 76 66 69 6c 6c 5c | 65 6a 65 63 74 0a 5c 63 |%\vfill\|eject.\c|
|00000010| 68 61 70 74 65 72 7b 45 | 78 70 72 65 73 73 69 6f |hapter{E|xpressio|
|00000020| 6e 73 7d 0a 5c 6c 61 62 | 65 6c 7b 65 78 70 72 65 |ns}.\lab|el{expre|
|00000030| 73 73 69 6f 6e 63 68 61 | 70 74 65 72 7d 0a 0a 5c |ssioncha|pter}..\|
|00000040| 6e 65 77 63 6f 6d 6d 61 | 6e 64 7b 5c 73 79 6e 74 |newcomma|nd{\synt|
|00000050| 61 78 7d 7b 7b 5c 65 6d | 20 53 79 6e 74 61 78 3a |ax}{{\em| Syntax:|
|00000060| 20 7d 7d 0a 5c 6e 65 77 | 63 6f 6d 6d 61 6e 64 7b | }}.\new|command{|
|00000070| 5c 73 65 6d 61 6e 74 69 | 63 73 7d 7b 7b 5c 65 6d |\semanti|cs}{{\em|
|00000080| 20 53 65 6d 61 6e 74 69 | 63 73 3a 20 7d 7d 0a 0a | Semanti|cs: }}..|
|00000090| 41 20 53 63 68 65 6d 65 | 20 65 78 70 72 65 73 73 |A Scheme| express|
|000000a0| 69 6f 6e 20 69 73 20 61 | 20 63 6f 6e 73 74 72 75 |ion is a| constru|
|000000b0| 63 74 20 74 68 61 74 20 | 72 65 74 75 72 6e 73 20 |ct that |returns |
|000000c0| 61 20 76 61 6c 75 65 2c | 20 73 75 63 68 20 61 73 |a value,| such as|
|000000d0| 20 61 0a 76 61 72 69 61 | 62 6c 65 20 72 65 66 65 | a.varia|ble refe|
|000000e0| 72 65 6e 63 65 2c 20 6c | 69 74 65 72 61 6c 2c 20 |rence, l|iteral, |
|000000f0| 70 72 6f 63 65 64 75 72 | 65 20 63 61 6c 6c 2c 20 |procedur|e call, |
|00000100| 6f 72 20 63 6f 6e 64 69 | 74 69 6f 6e 61 6c 2e 0a |or condi|tional..|
|00000110| 0a 45 78 70 72 65 73 73 | 69 6f 6e 20 74 79 70 65 |.Express|ion type|
|00000120| 73 20 61 72 65 20 63 61 | 74 65 67 6f 72 69 7a 65 |s are ca|tegorize|
|00000130| 64 20 61 73 20 7b 5c 65 | 6d 20 70 72 69 6d 69 74 |d as {\e|m primit|
|00000140| 69 76 65 7d 20 6f 72 20 | 7b 5c 65 6d 20 64 65 72 |ive} or |{\em der|
|00000150| 69 76 65 64 7d 2e 0a 50 | 72 69 6d 69 74 69 76 65 |ived}..P|rimitive|
|00000160| 20 65 78 70 72 65 73 73 | 69 6f 6e 20 74 79 70 65 | express|ion type|
|00000170| 73 20 69 6e 63 6c 75 64 | 65 20 76 61 72 69 61 62 |s includ|e variab|
|00000180| 6c 65 73 20 61 6e 64 20 | 70 72 6f 63 65 64 75 72 |les and |procedur|
|00000190| 65 20 63 61 6c 6c 73 2e | 0a 44 65 72 69 76 65 64 |e calls.|.Derived|
|000001a0| 20 65 78 70 72 65 73 73 | 69 6f 6e 20 74 79 70 65 | express|ion type|
|000001b0| 73 20 61 72 65 20 6e 6f | 74 20 73 65 6d 61 6e 74 |s are no|t semant|
|000001c0| 69 63 61 6c 6c 79 20 70 | 72 69 6d 69 74 69 76 65 |ically p|rimitive|
|000001d0| 2c 20 62 75 74 20 63 61 | 6e 20 69 6e 73 74 65 61 |, but ca|n instea|
|000001e0| 64 0a 62 65 20 65 78 70 | 6c 61 69 6e 65 64 20 69 |d.be exp|lained i|
|000001f0| 6e 20 74 65 72 6d 73 20 | 6f 66 20 74 68 65 20 70 |n terms |of the p|
|00000200| 72 69 6d 69 74 69 76 65 | 20 63 6f 6e 73 74 72 75 |rimitive| constru|
|00000210| 63 74 73 20 61 73 20 69 | 6e 0a 73 65 63 74 69 6f |cts as i|n.sectio|
|00000220| 6e 7e 5c 72 65 66 7b 64 | 65 72 69 76 65 64 73 65 |n~\ref{d|erivedse|
|00000230| 63 74 69 6f 6e 7d 2e 20 | 20 54 68 65 79 20 61 72 |ction}. | They ar|
|00000240| 65 20 72 65 64 75 6e 64 | 61 6e 74 20 69 6e 20 74 |e redund|ant in t|
|00000250| 68 65 20 73 74 72 69 63 | 74 20 73 65 6e 73 65 20 |he stric|t sense |
|00000260| 6f 66 0a 74 68 65 20 77 | 6f 72 64 2c 20 62 75 74 |of.the w|ord, but|
|00000270| 20 74 68 65 79 20 63 61 | 70 74 75 72 65 20 63 6f | they ca|pture co|
|00000280| 6d 6d 6f 6e 20 70 61 74 | 74 65 72 6e 73 20 6f 66 |mmon pat|terns of|
|00000290| 20 75 73 61 67 65 2c 20 | 61 6e 64 20 61 72 65 20 | usage, |and are |
|000002a0| 74 68 65 72 65 66 6f 72 | 65 0a 70 72 6f 76 69 64 |therefor|e.provid|
|000002b0| 65 64 20 61 73 20 63 6f | 6e 76 65 6e 69 65 6e 74 |ed as co|nvenient|
|000002c0| 20 61 62 62 72 65 76 69 | 61 74 69 6f 6e 73 2e 0a | abbrevi|ations..|
|000002d0| 0a 5c 73 65 63 74 69 6f | 6e 7b 50 72 69 6d 69 74 |.\sectio|n{Primit|
|000002e0| 69 76 65 20 65 78 70 72 | 65 73 73 69 6f 6e 20 74 |ive expr|ession t|
|000002f0| 79 70 65 73 7d 0a 5c 6c | 61 62 65 6c 7b 70 72 69 |ypes}.\l|abel{pri|
|00000300| 6d 69 74 69 76 65 78 70 | 73 7d 0a 0a 5c 73 75 62 |mitivexp|s}..\sub|
|00000310| 73 65 63 74 69 6f 6e 7b | 56 61 72 69 61 62 6c 65 |section{|Variable|
|00000320| 20 72 65 66 65 72 65 6e | 63 65 73 7d 5c 75 6e 73 | referen|ces}\uns|
|00000330| 65 63 74 69 6f 6e 0a 0a | 5c 62 65 67 69 6e 7b 65 |ection..|\begin{e|
|00000340| 6e 74 72 79 7d 7b 25 0a | 5c 70 70 72 6f 74 6f 7b |ntry}{%.|\pproto{|
|00000350| 5c 68 79 70 65 72 7b 76 | 61 72 69 61 62 6c 65 7d |\hyper{v|ariable}|
|00000360| 7d 7b 65 73 73 65 6e 74 | 69 61 6c 20 5c 65 78 70 |}{essent|ial \exp|
|00000370| 72 74 79 70 65 7d 7d 0a | 0a 41 6e 20 65 78 70 72 |rtype}}.|.An expr|
|00000380| 65 73 73 69 6f 6e 20 63 | 6f 6e 73 69 73 74 69 6e |ession c|onsistin|
|00000390| 67 20 6f 66 20 61 20 76 | 61 72 69 61 62 6c 65 5c |g of a v|ariable\|
|000003a0| 69 6e 64 65 78 7b 76 61 | 72 69 61 62 6c 65 7d 0a |index{va|riable}.|
|000003b0| 28 73 65 63 74 69 6f 6e | 7e 5c 72 65 66 7b 76 61 |(section|~\ref{va|
|000003c0| 72 69 61 62 6c 65 73 65 | 63 74 69 6f 6e 7d 29 20 |riablese|ction}) |
|000003d0| 69 73 20 61 20 76 61 72 | 69 61 62 6c 65 20 72 65 |is a var|iable re|
|000003e0| 66 65 72 65 6e 63 65 2e | 20 20 54 68 65 20 76 61 |ference.| The va|
|000003f0| 6c 75 65 20 6f 66 0a 74 | 68 65 20 76 61 72 69 61 |lue of.t|he varia|
|00000400| 62 6c 65 20 72 65 66 65 | 72 65 6e 63 65 20 69 73 |ble refe|rence is|
|00000410| 20 74 68 65 20 76 61 6c | 75 65 20 73 74 6f 72 65 | the val|ue store|
|00000420| 64 20 69 6e 20 74 68 65 | 20 6c 6f 63 61 74 69 6f |d in the| locatio|
|00000430| 6e 20 74 6f 20 77 68 69 | 63 68 20 74 68 65 0a 76 |n to whi|ch the.v|
|00000440| 61 72 69 61 62 6c 65 20 | 69 73 20 62 6f 75 6e 64 |ariable |is bound|
|00000450| 2e 20 20 49 74 20 69 73 | 20 61 6e 20 65 72 72 6f |. It is| an erro|
|00000460| 72 20 74 6f 20 72 65 66 | 65 72 65 6e 63 65 20 61 |r to ref|erence a|
|00000470| 6e 0a 75 6e 62 6f 75 6e | 64 5c 69 6e 64 65 78 7b |n.unboun|d\index{|
|00000480| 75 6e 62 6f 75 6e 64 7d | 20 76 61 72 69 61 62 6c |unbound}| variabl|
|00000490| 65 2e 0a 0a 5c 62 65 67 | 69 6e 7b 73 63 68 65 6d |e...\beg|in{schem|
|000004a0| 65 7d 0a 28 64 65 66 69 | 6e 65 20 78 20 32 38 29 |e}.(defi|ne x 28)|
|000004b0| 0a 78 20 20 20 5c 65 76 | 20 20 32 38 25 0a 5c 65 |.x \ev| 28%.\e|
|000004c0| 6e 64 7b 73 63 68 65 6d | 65 7d 0a 5c 65 6e 64 7b |nd{schem|e}.\end{|
|000004d0| 65 6e 74 72 79 7d 0a 0a | 5c 73 75 62 73 65 63 74 |entry}..|\subsect|
|000004e0| 69 6f 6e 7b 4c 69 74 65 | 72 61 6c 20 65 78 70 72 |ion{Lite|ral expr|
|000004f0| 65 73 73 69 6f 6e 73 7d | 5c 75 6e 73 65 63 74 69 |essions}|\unsecti|
|00000500| 6f 6e 0a 5c 6c 61 62 65 | 6c 7b 6c 69 74 65 72 61 |on.\labe|l{litera|
|00000510| 6c 73 65 63 74 69 6f 6e | 7d 0a 0a 5c 62 65 67 69 |lsection|}..\begi|
|00000520| 6e 7b 65 6e 74 72 79 7d | 7b 25 0a 5c 70 72 6f 74 |n{entry}|{%.\prot|
|00000530| 6f 7b 71 75 6f 74 65 7d | 7b 20 5c 68 79 70 65 72 |o{quote}|{ \hyper|
|00000540| 7b 64 61 74 75 6d 7d 7d | 7b 65 73 73 65 6e 74 69 |{datum}}|{essenti|
|00000550| 61 6c 20 5c 65 78 70 72 | 74 79 70 65 7d 0a 5c 70 |al \expr|type}.\p|
|00000560| 70 72 6f 74 6f 7b 5c 73 | 69 6e 67 6c 65 71 75 6f |proto{\s|inglequo|
|00000570| 74 65 5c 68 79 70 65 72 | 7b 64 61 74 75 6d 7d 7d |te\hyper|{datum}}|
|00000580| 7b 65 73 73 65 6e 74 69 | 61 6c 20 5c 65 78 70 72 |{essenti|al \expr|
|00000590| 74 79 70 65 7d 0a 5c 70 | 70 72 6f 74 6f 7b 5c 68 |type}.\p|proto{\h|
|000005a0| 79 70 65 72 7b 63 6f 6e | 73 74 61 6e 74 7d 7d 7b |yper{con|stant}}{|
|000005b0| 65 73 73 65 6e 74 69 61 | 6c 20 5c 65 78 70 72 74 |essentia|l \exprt|
|000005c0| 79 70 65 7d 7d 0a 0a 7b | 5c 63 66 20 28 71 75 6f |ype}}..{|\cf (quo|
|000005d0| 74 65 20 5c 68 79 70 65 | 72 7b 64 61 74 75 6d 7d |te \hype|r{datum}|
|000005e0| 29 7d 20 65 76 61 6c 75 | 61 74 65 73 20 74 6f 20 |)} evalu|ates to |
|000005f0| 5c 68 79 70 65 72 7b 64 | 61 74 75 6d 7d 2e 5c 6d |\hyper{d|atum}.\m|
|00000600| 61 69 6e 73 63 68 69 6e | 64 65 78 7b 27 7d 0a 5c |ainschin|dex{'}.\|
|00000610| 68 79 70 65 72 7b 44 61 | 74 75 6d 7d 0a 6d 61 79 |hyper{Da|tum}.may|
|00000620| 20 62 65 20 61 6e 79 20 | 65 78 74 65 72 6e 61 6c | be any |external|
|00000630| 20 72 65 70 72 65 73 65 | 6e 74 61 74 69 6f 6e 20 | represe|ntation |
|00000640| 6f 66 20 61 20 53 63 68 | 65 6d 65 20 6f 62 6a 65 |of a Sch|eme obje|
|00000650| 63 74 20 28 73 65 65 0a | 73 65 63 74 69 6f 6e 7e |ct (see.|section~|
|00000660| 5c 72 65 66 7b 65 78 74 | 65 72 6e 61 6c 72 65 70 |\ref{ext|ernalrep|
|00000670| 73 7d 29 2e 20 20 54 68 | 69 73 20 6e 6f 74 61 74 |s}). Th|is notat|
|00000680| 69 6f 6e 20 69 73 20 75 | 73 65 64 20 74 6f 20 69 |ion is u|sed to i|
|00000690| 6e 63 6c 75 64 65 20 6c | 69 74 65 72 61 6c 0a 63 |nclude l|iteral.c|
|000006a0| 6f 6e 73 74 61 6e 74 73 | 20 69 6e 20 53 63 68 65 |onstants| in Sche|
|000006b0| 6d 65 20 63 6f 64 65 2e | 20 5c 69 6e 64 65 78 7b |me code.| \index{|
|000006c0| 63 6f 6e 73 74 61 6e 74 | 7d 0a 0a 5c 62 65 67 69 |constant|}..\begi|
|000006d0| 6e 7b 73 63 68 65 6d 65 | 7d 25 0a 28 71 75 6f 74 |n{scheme|}%.(quot|
|000006e0| 65 20 61 29 20 20 20 20 | 20 20 20 20 20 20 20 20 |e a) | |
|000006f0| 20 20 20 20 20 20 20 20 | 20 5c 65 76 20 20 61 0a | | \ev a.|
|00000700| 28 71 75 6f 74 65 20 5c | 73 68 61 72 70 73 69 67 |(quote \|sharpsig|
|00000710| 6e 28 61 20 62 20 63 29 | 29 20 20 20 20 20 5c 65 |n(a b c)|) \e|
|00000720| 76 20 20 5c 23 28 61 20 | 62 20 63 29 0a 28 71 75 |v \#(a |b c).(qu|
|00000730| 6f 74 65 20 28 2b 20 31 | 20 32 29 29 20 20 20 20 |ote (+ 1| 2)) |
|00000740| 20 20 20 20 20 20 20 20 | 20 20 20 5c 65 76 20 20 | | \ev |
|00000750| 28 2b 20 31 20 32 29 25 | 0a 5c 65 6e 64 7b 73 63 |(+ 1 2)%|.\end{sc|
|00000760| 68 65 6d 65 7d 0a 0a 7b | 5c 63 66 20 28 71 75 6f |heme}..{|\cf (quo|
|00000770| 74 65 20 5c 68 79 70 65 | 72 7b 64 61 74 75 6d 7d |te \hype|r{datum}|
|00000780| 29 7d 20 6d 61 79 20 62 | 65 20 61 62 62 72 65 76 |)} may b|e abbrev|
|00000790| 69 61 74 65 64 20 61 73 | 0a 5c 73 69 6e 67 6c 65 |iated as|.\single|
|000007a0| 71 75 6f 74 65 5c 68 79 | 70 65 72 7b 64 61 74 75 |quote\hy|per{datu|
|000007b0| 6d 7d 2e 20 20 54 68 65 | 20 74 77 6f 20 6e 6f 74 |m}. The| two not|
|000007c0| 61 74 69 6f 6e 73 20 61 | 72 65 20 65 71 75 69 76 |ations a|re equiv|
|000007d0| 61 6c 65 6e 74 20 69 6e | 20 61 6c 6c 0a 72 65 73 |alent in| all.res|
|000007e0| 70 65 63 74 73 2e 0a 0a | 5c 62 65 67 69 6e 7b 73 |pects...|\begin{s|
|000007f0| 63 68 65 6d 65 7d 0a 27 | 61 20 20 20 20 20 20 20 |cheme}.'|a |
|00000800| 20 20 20 20 20 20 20 20 | 20 20 20 20 5c 65 76 20 | | \ev |
|00000810| 20 61 0a 27 5c 23 28 61 | 20 62 20 63 29 20 20 20 | a.'\#(a| b c) |
|00000820| 20 20 20 20 20 20 20 20 | 5c 65 76 20 20 5c 23 28 | |\ev \#(|
|00000830| 61 20 62 20 63 29 0a 27 | 28 29 20 20 20 20 20 20 |a b c).'|() |
|00000840| 20 20 20 20 20 20 20 20 | 20 20 20 20 5c 65 76 20 | | \ev |
|00000850| 20 28 29 0a 27 28 2b 20 | 31 20 32 29 20 20 20 20 | ().'(+ |1 2) |
|00000860| 20 20 20 20 20 20 20 20 | 20 5c 65 76 20 20 28 2b | | \ev (+|
|00000870| 20 31 20 32 29 0a 27 28 | 71 75 6f 74 65 20 61 29 | 1 2).'(|quote a)|
|00000880| 20 20 20 20 20 20 20 20 | 20 20 20 5c 65 76 20 20 | | \ev |
|00000890| 28 71 75 6f 74 65 20 61 | 29 0a 27 27 61 20 20 20 |(quote a|).''a |
|000008a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 5c | | \|
|000008b0| 65 76 20 20 28 71 75 6f | 74 65 20 61 29 25 0a 5c |ev (quo|te a)%.\|
|000008c0| 65 6e 64 7b 73 63 68 65 | 6d 65 7d 0a 0a 4e 75 6d |end{sche|me}..Num|
|000008d0| 65 72 69 63 61 6c 20 63 | 6f 6e 73 74 61 6e 74 73 |erical c|onstants|
|000008e0| 2c 20 73 74 72 69 6e 67 | 20 63 6f 6e 73 74 61 6e |, string| constan|
|000008f0| 74 73 2c 20 63 68 61 72 | 61 63 74 65 72 20 63 6f |ts, char|acter co|
|00000900| 6e 73 74 61 6e 74 73 2c | 20 61 6e 64 20 62 6f 6f |nstants,| and boo|
|00000910| 6c 65 61 6e 0a 63 6f 6e | 73 74 61 6e 74 73 20 65 |lean.con|stants e|
|00000920| 76 61 6c 75 61 74 65 20 | 60 60 74 6f 20 74 68 65 |valuate |``to the|
|00000930| 6d 73 65 6c 76 65 73 27 | 27 3b 20 74 68 65 79 20 |mselves'|'; they |
|00000940| 6e 65 65 64 20 6e 6f 74 | 20 62 65 20 71 75 6f 74 |need not| be quot|
|00000950| 65 64 2e 0a 0a 5c 62 65 | 67 69 6e 7b 73 63 68 65 |ed...\be|gin{sche|
|00000960| 6d 65 7d 0a 27 22 61 62 | 63 22 20 20 20 20 20 5c |me}.'"ab|c" \|
|00000970| 65 76 20 20 22 61 62 63 | 22 0a 22 61 62 63 22 20 |ev "abc|"."abc" |
|00000980| 20 20 20 20 20 5c 65 76 | 20 20 22 61 62 63 22 0a | \ev| "abc".|
|00000990| 27 31 34 35 39 33 32 20 | 20 20 20 5c 65 76 20 20 |'145932 | \ev |
|000009a0| 31 34 35 39 33 32 0a 31 | 34 35 39 33 32 20 20 20 |145932.1|45932 |
|000009b0| 20 20 5c 65 76 20 20 31 | 34 35 39 33 32 0a 27 5c | \ev 1|45932.'\|
|000009c0| 73 63 68 74 72 75 65 20 | 20 5c 65 76 20 20 5c 73 |schtrue | \ev \s|
|000009d0| 63 68 74 72 75 65 0a 5c | 73 63 68 74 72 75 65 20 |chtrue.\|schtrue |
|000009e0| 20 20 5c 65 76 20 20 5c | 73 63 68 74 72 75 65 25 | \ev \|schtrue%|
|000009f0| 0a 5c 65 6e 64 7b 73 63 | 68 65 6d 65 7d 0a 0a 41 |.\end{sc|heme}..A|
|00000a00| 73 20 6e 6f 74 65 64 20 | 69 6e 20 73 65 63 74 69 |s noted |in secti|
|00000a10| 6f 6e 7e 5c 72 65 66 7b | 73 74 6f 72 61 67 65 6d |on~\ref{|storagem|
|00000a20| 6f 64 65 6c 7d 2c 20 69 | 74 20 69 73 20 61 6e 20 |odel}, i|t is an |
|00000a30| 65 72 72 6f 72 20 74 6f | 20 61 6c 74 65 72 20 61 |error to| alter a|
|00000a40| 20 63 6f 6e 73 74 61 6e | 74 0a 28 69 2e 65 2e 7e | constan|t.(i.e.~|
|00000a50| 74 68 65 20 76 61 6c 75 | 65 20 6f 66 20 61 20 6c |the valu|e of a l|
|00000a60| 69 74 65 72 61 6c 20 65 | 78 70 72 65 73 73 69 6f |iteral e|xpressio|
|00000a70| 6e 29 20 75 73 69 6e 67 | 20 61 20 6d 75 74 61 74 |n) using| a mutat|
|00000a80| 69 6f 6e 20 70 72 6f 63 | 65 64 75 72 65 20 6c 69 |ion proc|edure li|
|00000a90| 6b 65 0a 5c 69 64 65 7b | 73 65 74 2d 63 61 72 21 |ke.\ide{|set-car!|
|00000aa0| 7d 5c 20 6f 72 20 5c 69 | 64 65 7b 73 74 72 69 6e |}\ or \i|de{strin|
|00000ab0| 67 2d 73 65 74 21 7d 2e | 20 5c 69 6e 64 65 78 7b |g-set!}.| \index{|
|00000ac0| 63 6f 6e 73 74 61 6e 74 | 7d 0a 0a 5c 65 6e 64 7b |constant|}..\end{|
|00000ad0| 65 6e 74 72 79 7d 0a 0a | 0a 5c 73 75 62 73 65 63 |entry}..|.\subsec|
|00000ae0| 74 69 6f 6e 7b 50 72 6f | 63 65 64 75 72 65 20 63 |tion{Pro|cedure c|
|00000af0| 61 6c 6c 73 7d 5c 75 6e | 73 65 63 74 69 6f 6e 0a |alls}\un|section.|
|00000b00| 0a 5c 62 65 67 69 6e 7b | 65 6e 74 72 79 7d 7b 25 |.\begin{|entry}{%|
|00000b10| 0a 5c 70 70 72 6f 74 6f | 7b 28 5c 68 79 70 65 72 |.\pproto|{(\hyper|
|00000b20| 7b 6f 70 65 72 61 74 6f | 72 7d 20 5c 68 79 70 65 |{operato|r} \hype|
|00000b30| 72 69 7b 6f 70 65 72 61 | 6e 64 7d 20 5c 64 6f 74 |ri{opera|nd} \dot|
|00000b40| 73 66 6f 6f 29 7d 7b 65 | 73 73 65 6e 74 69 61 6c |sfoo)}{e|ssential|
|00000b50| 20 5c 65 78 70 72 74 79 | 70 65 7d 7d 0a 0a 41 20 | \exprty|pe}}..A |
|00000b60| 70 72 6f 63 65 64 75 72 | 65 20 63 61 6c 6c 20 69 |procedur|e call i|
|00000b70| 73 20 77 72 69 74 74 65 | 6e 20 62 79 20 73 69 6d |s writte|n by sim|
|00000b80| 70 6c 79 20 65 6e 63 6c | 6f 73 69 6e 67 20 69 6e |ply encl|osing in|
|00000b90| 20 70 61 72 65 6e 74 68 | 65 73 65 73 0a 65 78 70 | parenth|eses.exp|
|00000ba0| 72 65 73 73 69 6f 6e 73 | 20 66 6f 72 20 74 68 65 |ressions| for the|
|00000bb0| 20 70 72 6f 63 65 64 75 | 72 65 20 74 6f 20 62 65 | procedu|re to be|
|00000bc0| 20 63 61 6c 6c 65 64 20 | 61 6e 64 20 74 68 65 20 | called |and the |
|00000bd0| 61 72 67 75 6d 65 6e 74 | 73 20 74 6f 20 62 65 0a |argument|s to be.|
|00000be0| 70 61 73 73 65 64 20 74 | 6f 20 69 74 2e 20 20 54 |passed t|o it. T|
|00000bf0| 68 65 20 6f 70 65 72 61 | 74 6f 72 20 61 6e 64 20 |he opera|tor and |
|00000c00| 6f 70 65 72 61 6e 64 20 | 65 78 70 72 65 73 73 69 |operand |expressi|
|00000c10| 6f 6e 73 20 61 72 65 20 | 65 76 61 6c 75 61 74 65 |ons are |evaluate|
|00000c20| 64 20 28 69 6e 20 61 6e | 0a 75 6e 73 70 65 63 69 |d (in an|.unspeci|
|00000c30| 66 69 65 64 20 6f 72 64 | 65 72 29 20 61 6e 64 20 |fied ord|er) and |
|00000c40| 74 68 65 20 72 65 73 75 | 6c 74 69 6e 67 20 70 72 |the resu|lting pr|
|00000c50| 6f 63 65 64 75 72 65 20 | 69 73 20 70 61 73 73 65 |ocedure |is passe|
|00000c60| 64 20 74 68 65 20 72 65 | 73 75 6c 74 69 6e 67 0a |d the re|sulting.|
|00000c70| 61 72 67 75 6d 65 6e 74 | 73 2e 5c 6d 61 69 6e 69 |argument|s.\maini|
|00000c80| 6e 64 65 78 7b 63 61 6c | 6c 7d 5c 6d 61 69 6e 69 |ndex{cal|l}\maini|
|00000c90| 6e 64 65 78 7b 70 72 6f | 63 65 64 75 72 65 20 63 |ndex{pro|cedure c|
|00000ca0| 61 6c 6c 7d 0a 5c 62 65 | 67 69 6e 7b 73 63 68 65 |all}.\be|gin{sche|
|00000cb0| 6d 65 7d 25 0a 28 2b 20 | 33 20 34 29 20 20 20 20 |me}%.(+ |3 4) |
|00000cc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000cd0| 20 20 20 20 20 20 5c 65 | 76 20 20 37 0a 28 28 69 | \e|v 7.((i|
|00000ce0| 66 20 5c 73 63 68 66 61 | 6c 73 65 20 2b 20 2a 29 |f \schfa|lse + *)|
|00000cf0| 20 33 20 34 29 20 20 20 | 20 20 20 20 20 20 5c 65 | 3 4) | \e|
|00000d00| 76 20 20 31 32 25 0a 5c | 65 6e 64 7b 73 63 68 65 |v 12%.\|end{sche|
|00000d10| 6d 65 7d 0a 0a 41 20 6e | 75 6d 62 65 72 20 6f 66 |me}..A n|umber of|
|00000d20| 20 70 72 6f 63 65 64 75 | 72 65 73 20 61 72 65 20 | procedu|res are |
|00000d30| 61 76 61 69 6c 61 62 6c | 65 20 61 73 20 74 68 65 |availabl|e as the|
|00000d40| 20 76 61 6c 75 65 73 20 | 6f 66 20 76 61 72 69 61 | values |of varia|
|00000d50| 62 6c 65 73 20 69 6e 20 | 74 68 65 0a 69 6e 69 74 |bles in |the.init|
|00000d60| 69 61 6c 20 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 3b |ial envi|ronment;|
|00000d70| 20 66 6f 72 20 65 78 61 | 6d 70 6c 65 2c 20 74 68 | for exa|mple, th|
|00000d80| 65 20 61 64 64 69 74 69 | 6f 6e 20 61 6e 64 20 6d |e additi|on and m|
|00000d90| 75 6c 74 69 70 6c 69 63 | 61 74 69 6f 6e 0a 70 72 |ultiplic|ation.pr|
|00000da0| 6f 63 65 64 75 72 65 73 | 20 69 6e 20 74 68 65 20 |ocedures| in the |
|00000db0| 61 62 6f 76 65 20 65 78 | 61 6d 70 6c 65 73 20 61 |above ex|amples a|
|00000dc0| 72 65 20 74 68 65 20 76 | 61 6c 75 65 73 20 6f 66 |re the v|alues of|
|00000dd0| 20 74 68 65 20 76 61 72 | 69 61 62 6c 65 73 20 5c | the var|iables \|
|00000de0| 69 64 65 7b 2b 7d 0a 61 | 6e 64 20 5c 69 64 65 7b |ide{+}.a|nd \ide{|
|00000df0| 2a 7d 2e 20 20 4e 65 77 | 20 70 72 6f 63 65 64 75 |*}. New| procedu|
|00000e00| 72 65 73 20 61 72 65 20 | 63 72 65 61 74 65 64 20 |res are |created |
|00000e10| 62 79 20 65 76 61 6c 75 | 61 74 69 6e 67 20 5c 6c |by evalu|ating \l|
|00000e20| 61 6d 62 64 61 65 78 70 | 7b 7d 73 0a 28 73 65 65 |ambdaexp|{}s.(see|
|00000e30| 20 73 65 63 74 69 6f 6e | 7e 5c 72 65 66 7b 6c 61 | section|~\ref{la|
|00000e40| 6d 62 64 61 7d 29 2e 0a | 5c 74 6f 64 6f 7b 41 74 |mbda})..|\todo{At|
|00000e50| 20 46 72 69 65 64 6d 61 | 6e 27 73 20 72 65 75 65 | Friedma|n's reue|
|00000e60| 73 74 2c 20 66 6c 75 73 | 68 65 64 20 6d 65 6e 74 |st, flus|hed ment|
|00000e70| 69 6f 6e 20 6f 66 20 6f | 74 68 65 72 20 77 61 79 |ion of o|ther way|
|00000e80| 73 2e 7d 0a 25 20 6f 72 | 20 64 65 66 69 6e 69 74 |s.}.% or| definit|
|00000e90| 69 6f 6e 73 20 28 73 65 | 65 20 73 65 63 74 69 6f |ions (se|e sectio|
|00000ea0| 6e 7e 5c 72 65 66 7b 64 | 65 66 69 6e 65 7d 29 2e |n~\ref{d|efine}).|
|00000eb0| 0a 0a 50 72 6f 63 65 64 | 75 72 65 20 63 61 6c 6c |..Proced|ure call|
|00000ec0| 73 20 61 72 65 20 61 6c | 73 6f 20 63 61 6c 6c 65 |s are al|so calle|
|00000ed0| 64 20 7b 5c 65 6d 20 63 | 6f 6d 62 69 6e 61 74 69 |d {\em c|ombinati|
|00000ee0| 6f 6e 73 7d 2e 0a 5c 6d | 61 69 6e 69 6e 64 65 78 |ons}..\m|ainindex|
|00000ef0| 7b 63 6f 6d 62 69 6e 61 | 74 69 6f 6e 7d 0a 0a 5c |{combina|tion}..\|
|00000f00| 62 65 67 69 6e 7b 6e 6f | 74 65 7d 20 49 6e 20 63 |begin{no|te} In c|
|00000f10| 6f 6e 74 72 61 73 74 20 | 74 6f 20 6f 74 68 65 72 |ontrast |to other|
|00000f20| 20 64 69 61 6c 65 63 74 | 73 20 6f 66 20 4c 69 73 | dialect|s of Lis|
|00000f30| 70 2c 20 74 68 65 20 6f | 72 64 65 72 20 6f 66 0a |p, the o|rder of.|
|00000f40| 65 76 61 6c 75 61 74 69 | 6f 6e 20 69 73 20 75 6e |evaluati|on is un|
|00000f50| 73 70 65 63 69 66 69 65 | 64 2c 20 61 6e 64 20 74 |specifie|d, and t|
|00000f60| 68 65 20 6f 70 65 72 61 | 74 6f 72 20 65 78 70 72 |he opera|tor expr|
|00000f70| 65 73 73 69 6f 6e 20 61 | 6e 64 20 74 68 65 20 6f |ession a|nd the o|
|00000f80| 70 65 72 61 6e 64 0a 65 | 78 70 72 65 73 73 69 6f |perand.e|xpressio|
|00000f90| 6e 73 20 61 72 65 20 61 | 6c 77 61 79 73 20 65 76 |ns are a|lways ev|
|00000fa0| 61 6c 75 61 74 65 64 20 | 77 69 74 68 20 74 68 65 |aluated |with the|
|00000fb0| 20 73 61 6d 65 20 65 76 | 61 6c 75 61 74 69 6f 6e | same ev|aluation|
|00000fc0| 20 72 75 6c 65 73 2e 0a | 5c 65 6e 64 7b 6e 6f 74 | rules..|\end{not|
|00000fd0| 65 7d 0a 0a 5c 62 65 67 | 69 6e 7b 6e 6f 74 65 7d |e}..\beg|in{note}|
|00000fe0| 0a 41 6c 74 68 6f 75 67 | 68 20 74 68 65 20 6f 72 |.Althoug|h the or|
|00000ff0| 64 65 72 20 6f 66 20 65 | 76 61 6c 75 61 74 69 6f |der of e|valuatio|
|00001000| 6e 20 69 73 20 6f 74 68 | 65 72 77 69 73 65 20 75 |n is oth|erwise u|
|00001010| 6e 73 70 65 63 69 66 69 | 65 64 2c 20 74 68 65 20 |nspecifi|ed, the |
|00001020| 65 66 66 65 63 74 20 6f | 66 0a 61 6e 79 20 63 6f |effect o|f.any co|
|00001030| 6e 63 75 72 72 65 6e 74 | 20 65 76 61 6c 75 61 74 |ncurrent| evaluat|
|00001040| 69 6f 6e 20 6f 66 20 74 | 68 65 20 6f 70 65 72 61 |ion of t|he opera|
|00001050| 74 6f 72 20 61 6e 64 20 | 6f 70 65 72 61 6e 64 20 |tor and |operand |
|00001060| 65 78 70 72 65 73 73 69 | 6f 6e 73 20 69 73 0a 63 |expressi|ons is.c|
|00001070| 6f 6e 73 74 72 61 69 6e | 65 64 20 74 6f 20 62 65 |onstrain|ed to be|
|00001080| 20 63 6f 6e 73 69 73 74 | 65 6e 74 20 77 69 74 68 | consist|ent with|
|00001090| 20 73 6f 6d 65 20 73 65 | 71 75 65 6e 74 69 61 6c | some se|quential|
|000010a0| 20 6f 72 64 65 72 20 6f | 66 20 65 76 61 6c 75 61 | order o|f evalua|
|000010b0| 74 69 6f 6e 2e 0a 54 68 | 65 20 6f 72 64 65 72 20 |tion..Th|e order |
|000010c0| 6f 66 20 65 76 61 6c 75 | 61 74 69 6f 6e 20 6d 61 |of evalu|ation ma|
|000010d0| 79 20 62 65 20 63 68 6f | 73 65 6e 20 64 69 66 66 |y be cho|sen diff|
|000010e0| 65 72 65 6e 74 6c 79 20 | 66 6f 72 20 65 61 63 68 |erently |for each|
|000010f0| 20 70 72 6f 63 65 64 75 | 72 65 20 63 61 6c 6c 2e | procedu|re call.|
|00001100| 0a 5c 65 6e 64 7b 6e 6f | 74 65 7d 0a 0a 5c 62 65 |.\end{no|te}..\be|
|00001110| 67 69 6e 7b 6e 6f 74 65 | 7d 20 49 6e 20 6d 61 6e |gin{note|} In man|
|00001120| 79 20 64 69 61 6c 65 63 | 74 73 20 6f 66 20 4c 69 |y dialec|ts of Li|
|00001130| 73 70 2c 20 74 68 65 20 | 65 6d 70 74 79 20 63 6f |sp, the |empty co|
|00001140| 6d 62 69 6e 61 74 69 6f | 6e 2c 20 7b 5c 74 74 0a |mbinatio|n, {\tt.|
|00001150| 28 29 7d 2c 20 69 73 20 | 61 20 6c 65 67 69 74 69 |()}, is |a legiti|
|00001160| 6d 61 74 65 20 65 78 70 | 72 65 73 73 69 6f 6e 2e |mate exp|ression.|
|00001170| 20 20 49 6e 20 53 63 68 | 65 6d 65 2c 20 63 6f 6d | In Sch|eme, com|
|00001180| 62 69 6e 61 74 69 6f 6e | 73 20 6d 75 73 74 20 68 |bination|s must h|
|00001190| 61 76 65 20 61 74 0a 6c | 65 61 73 74 20 6f 6e 65 |ave at.l|east one|
|000011a0| 20 73 75 62 65 78 70 72 | 65 73 73 69 6f 6e 2c 20 | subexpr|ession, |
|000011b0| 73 6f 20 7b 5c 74 74 20 | 28 29 7d 20 69 73 20 6e |so {\tt |()} is n|
|000011c0| 6f 74 20 61 20 73 79 6e | 74 61 63 74 69 63 61 6c |ot a syn|tactical|
|000011d0| 6c 79 20 76 61 6c 69 64 | 0a 65 78 70 72 65 73 73 |ly valid|.express|
|000011e0| 69 6f 6e 2e 20 20 5c 74 | 6f 64 6f 7b 44 79 62 76 |ion. \t|odo{Dybv|
|000011f0| 69 67 3a 20 60 60 69 74 | 20 73 68 6f 75 6c 64 20 |ig: ``it| should |
|00001200| 62 65 20 6f 62 76 69 6f | 75 73 20 66 72 6f 6d 20 |be obvio|us from |
|00001210| 74 68 65 20 73 79 6e 74 | 61 78 2e 27 27 7d 0a 5c |the synt|ax.''}.\|
|00001220| 65 6e 64 7b 6e 6f 74 65 | 7d 0a 0a 5c 74 6f 64 6f |end{note|}..\todo|
|00001230| 7b 46 72 65 65 6d 61 6e | 3a 0a 49 20 74 68 69 6e |{Freeman|:.I thin|
|00001240| 6b 20 61 6e 20 65 78 70 | 6c 61 6e 61 74 69 6f 6e |k an exp|lanation|
|00001250| 20 61 73 20 74 6f 20 77 | 68 79 20 65 76 61 6c 75 | as to w|hy evalu|
|00001260| 61 74 69 6f 6e 20 6f 72 | 64 65 72 20 69 73 20 6e |ation or|der is n|
|00001270| 6f 74 20 73 70 65 63 69 | 66 69 65 64 0a 73 68 6f |ot speci|fied.sho|
|00001280| 75 6c 64 20 62 65 20 69 | 6e 63 6c 75 64 65 64 2e |uld be i|ncluded.|
|00001290| 20 20 49 74 20 73 68 6f | 75 6c 64 20 6e 6f 74 20 | It sho|uld not |
|000012a0| 69 6e 63 6c 75 64 65 20 | 61 6e 79 20 72 65 66 65 |include |any refe|
|000012b0| 72 65 6e 63 65 20 74 6f | 20 70 61 72 61 6c 6c 65 |rence to| paralle|
|000012c0| 6c 0a 65 76 61 6c 75 61 | 74 69 6f 6e 2e 20 20 44 |l.evalua|tion. D|
|000012d0| 6f 65 73 20 61 6e 79 20 | 65 78 69 73 74 69 6e 67 |oes any |existing|
|000012e0| 20 63 6f 6d 70 69 6c 65 | 72 20 67 65 6e 65 72 61 | compile|r genera|
|000012f0| 74 65 20 62 65 74 74 65 | 72 20 63 6f 64 65 20 62 |te bette|r code b|
|00001300| 65 63 61 75 73 65 0a 74 | 68 65 20 65 76 61 6c 75 |ecause.t|he evalu|
|00001310| 61 74 69 6f 6e 20 6f 72 | 64 65 72 20 69 73 20 75 |ation or|der is u|
|00001320| 6e 73 70 65 63 69 66 69 | 65 64 3f 20 20 43 6c 69 |nspecifi|ed? Cli|
|00001330| 6e 67 65 72 3a 20 79 65 | 73 3a 20 54 33 2c 20 4d |nger: ye|s: T3, M|
|00001340| 61 63 53 63 68 65 6d 65 | 20 76 32 2c 0a 70 72 6f |acScheme| v2,.pro|
|00001350| 62 61 62 6c 79 20 4d 49 | 54 20 53 63 68 65 6d 65 |bably MI|T Scheme|
|00001360| 20 61 6e 64 20 43 68 65 | 7a 20 53 63 68 65 6d 65 | and Che|z Scheme|
|00001370| 2e 20 20 42 75 74 20 74 | 68 61 74 27 73 20 6e 6f |. But t|hat's no|
|00001380| 74 20 74 68 65 20 6d 61 | 69 6e 20 72 65 61 73 6f |t the ma|in reaso|
|00001390| 6e 0a 66 6f 72 20 6c 65 | 61 76 69 6e 67 20 74 68 |n.for le|aving th|
|000013a0| 65 20 6f 72 64 65 72 20 | 75 6e 73 70 65 63 69 66 |e order |unspecif|
|000013b0| 69 65 64 2e 7d 0a 0a 5c | 65 6e 64 7b 65 6e 74 72 |ied.}..\|end{entr|
|000013c0| 79 7d 0a 0a 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |y}...\su|bsection|
|000013d0| 7b 5c 4c 61 6d 62 64 61 | 65 78 70 7b 7d 73 7d 5c |{\Lambda|exp{}s}\|
|000013e0| 75 6e 73 65 63 74 69 6f | 6e 0a 5c 6c 61 62 65 6c |unsectio|n.\label|
|000013f0| 7b 6c 61 6d 62 61 7d 0a | 0a 5c 62 65 67 69 6e 7b |{lamba}.|.\begin{|
|00001400| 65 6e 74 72 79 7d 7b 25 | 0a 5c 70 72 6f 74 6f 7b |entry}{%|.\proto{|
|00001410| 6c 61 6d 62 64 61 7d 7b | 20 5c 68 79 70 65 72 7b |lambda}{| \hyper{|
|00001420| 66 6f 72 6d 61 6c 73 7d | 20 5c 68 79 70 65 72 7b |formals}| \hyper{|
|00001430| 62 6f 64 79 7d 7d 7b 65 | 73 73 65 6e 74 69 61 6c |body}}{e|ssential|
|00001440| 20 5c 65 78 70 72 74 79 | 70 65 7d 7d 0a 0a 5c 73 | \exprty|pe}}..\s|
|00001450| 79 6e 74 61 78 0a 5c 68 | 79 70 65 72 7b 46 6f 72 |yntax.\h|yper{For|
|00001460| 6d 61 6c 73 7d 20 73 68 | 6f 75 6c 64 20 62 65 20 |mals} sh|ould be |
|00001470| 61 20 66 6f 72 6d 61 6c | 20 61 72 67 75 6d 65 6e |a formal| argumen|
|00001480| 74 73 20 6c 69 73 74 20 | 61 73 20 64 65 73 63 72 |ts list |as descr|
|00001490| 69 62 65 64 20 62 65 6c | 6f 77 2c 0a 61 6e 64 20 |ibed bel|ow,.and |
|000014a0| 5c 68 79 70 65 72 7b 62 | 6f 64 79 7d 20 73 68 6f |\hyper{b|ody} sho|
|000014b0| 75 6c 64 20 62 65 20 61 | 20 73 65 71 75 65 6e 63 |uld be a| sequenc|
|000014c0| 65 20 6f 66 20 6f 6e 65 | 20 6f 72 20 6d 6f 72 65 |e of one| or more|
|000014d0| 20 65 78 70 72 65 73 73 | 69 6f 6e 73 2e 0a 0a 5c | express|ions...\|
|000014e0| 73 65 6d 61 6e 74 69 63 | 73 0a 5c 76 65 73 74 20 |semantic|s.\vest |
|000014f0| 41 20 5c 6c 61 6d 62 64 | 61 65 78 70 7b 7d 20 65 |A \lambd|aexp{} e|
|00001500| 76 61 6c 75 61 74 65 73 | 20 74 6f 20 61 20 70 72 |valuates| to a pr|
|00001510| 6f 63 65 64 75 72 65 2e | 20 20 54 68 65 20 65 6e |ocedure.| The en|
|00001520| 76 69 72 6f 6e 6d 65 6e | 74 20 69 6e 0a 65 66 66 |vironmen|t in.eff|
|00001530| 65 63 74 20 77 68 65 6e | 20 74 68 65 20 5c 6c 61 |ect when| the \la|
|00001540| 6d 62 64 61 65 78 70 7b | 7d 20 77 61 73 20 65 76 |mbdaexp{|} was ev|
|00001550| 61 6c 75 61 74 65 64 20 | 69 73 20 72 65 6d 65 6d |aluated |is remem|
|00001560| 62 65 72 65 64 20 61 73 | 20 70 61 72 74 20 6f 66 |bered as| part of|
|00001570| 20 74 68 65 0a 70 72 6f | 63 65 64 75 72 65 2e 20 | the.pro|cedure. |
|00001580| 20 57 68 65 6e 20 74 68 | 65 20 70 72 6f 63 65 64 | When th|e proced|
|00001590| 75 72 65 20 69 73 20 6c | 61 74 65 72 20 63 61 6c |ure is l|ater cal|
|000015a0| 6c 65 64 20 77 69 74 68 | 20 73 6f 6d 65 20 61 63 |led with| some ac|
|000015b0| 74 75 61 6c 0a 61 72 67 | 75 6d 65 6e 74 73 2c 20 |tual.arg|uments, |
|000015c0| 74 68 65 20 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 20 |the envi|ronment |
|000015d0| 69 6e 20 77 68 69 63 68 | 20 74 68 65 20 5c 6c 61 |in which| the \la|
|000015e0| 6d 62 64 61 65 78 70 7b | 7d 20 77 61 73 20 65 76 |mbdaexp{|} was ev|
|000015f0| 61 6c 75 61 74 65 64 20 | 77 69 6c 6c 0a 62 65 20 |aluated |will.be |
|00001600| 65 78 74 65 6e 64 65 64 | 20 62 79 20 62 69 6e 64 |extended| by bind|
|00001610| 69 6e 67 20 74 68 65 20 | 76 61 72 69 61 62 6c 65 |ing the |variable|
|00001620| 73 20 69 6e 20 74 68 65 | 20 66 6f 72 6d 61 6c 20 |s in the| formal |
|00001630| 61 72 67 75 6d 65 6e 74 | 20 6c 69 73 74 20 74 6f |argument| list to|
|00001640| 0a 66 72 65 73 68 20 6c | 6f 63 61 74 69 6f 6e 73 |.fresh l|ocations|
|00001650| 2c 20 74 68 65 20 63 6f | 72 72 65 73 70 6f 6e 64 |, the co|rrespond|
|00001660| 69 6e 67 20 61 63 74 75 | 61 6c 20 61 72 67 75 6d |ing actu|al argum|
|00001670| 65 6e 74 20 76 61 6c 75 | 65 73 20 77 69 6c 6c 20 |ent valu|es will |
|00001680| 62 65 20 73 74 6f 72 65 | 64 0a 69 6e 20 74 68 6f |be store|d.in tho|
|00001690| 73 65 20 6c 6f 63 61 74 | 69 6f 6e 73 2c 20 61 6e |se locat|ions, an|
|000016a0| 64 20 74 68 65 20 65 78 | 70 72 65 73 73 69 6f 6e |d the ex|pression|
|000016b0| 73 20 69 6e 20 74 68 65 | 20 62 6f 64 79 20 6f 66 |s in the| body of|
|000016c0| 20 74 68 65 20 5c 6c 61 | 6d 62 64 61 65 78 70 7b | the \la|mbdaexp{|
|000016d0| 7d 0a 77 69 6c 6c 20 62 | 65 20 65 76 61 6c 75 61 |}.will b|e evalua|
|000016e0| 74 65 64 20 73 65 71 75 | 65 6e 74 69 61 6c 6c 79 |ted sequ|entially|
|000016f0| 20 69 6e 20 74 68 65 20 | 65 78 74 65 6e 64 65 64 | in the |extended|
|00001700| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 2e 20 20 54 | environ|ment. T|
|00001710| 68 65 20 72 65 73 75 6c | 74 0a 6f 66 20 74 68 65 |he resul|t.of the|
|00001720| 20 6c 61 73 74 20 65 78 | 70 72 65 73 73 69 6f 6e | last ex|pression|
|00001730| 20 69 6e 20 74 68 65 20 | 62 6f 64 79 20 77 69 6c | in the |body wil|
|00001740| 6c 20 62 65 20 72 65 74 | 75 72 6e 65 64 20 61 73 |l be ret|urned as|
|00001750| 20 74 68 65 20 72 65 73 | 75 6c 74 20 6f 66 0a 74 | the res|ult of.t|
|00001760| 68 65 20 70 72 6f 63 65 | 64 75 72 65 20 63 61 6c |he proce|dure cal|
|00001770| 6c 2e 0a 0a 5c 62 65 67 | 69 6e 7b 73 63 68 65 6d |l...\beg|in{schem|
|00001780| 65 7d 0a 28 6c 61 6d 62 | 64 61 20 28 78 29 20 28 |e}.(lamb|da (x) (|
|00001790| 2b 20 78 20 78 29 29 20 | 20 20 20 20 20 5c 65 76 |+ x x)) | \ev|
|000017a0| 20 20 7b 5c 65 6d 7b 7d | 61 20 70 72 6f 63 65 64 | {\em{}|a proced|
|000017b0| 75 72 65 7d 0a 28 28 6c | 61 6d 62 64 61 20 28 78 |ure}.((l|ambda (x|
|000017c0| 29 20 28 2b 20 78 20 78 | 29 29 20 34 29 20 20 5c |) (+ x x|)) 4) \|
|000017d0| 65 76 20 20 38 0a 0a 28 | 64 65 66 69 6e 65 20 72 |ev 8..(|define r|
|000017e0| 65 76 65 72 73 65 2d 73 | 75 62 74 72 61 63 74 0a |everse-s|ubtract.|
|000017f0| 20 20 28 6c 61 6d 62 64 | 61 20 28 78 20 79 29 20 | (lambd|a (x y) |
|00001800| 28 2d 20 79 20 78 29 29 | 29 0a 28 72 65 76 65 72 |(- y x))|).(rever|
|00001810| 73 65 2d 73 75 62 74 72 | 61 63 74 20 37 20 31 30 |se-subtr|act 7 10|
|00001820| 29 20 20 20 20 20 20 20 | 20 20 5c 65 76 20 20 33 |) | \ev 3|
|00001830| 0a 0a 28 64 65 66 69 6e | 65 20 66 6f 6f 0a 20 20 |..(defin|e foo. |
|00001840| 28 6c 65 74 20 28 28 78 | 20 34 29 29 0a 20 20 20 |(let ((x| 4)). |
|00001850| 20 28 6c 61 6d 62 64 61 | 20 28 79 29 20 28 2b 20 | (lambda| (y) (+ |
|00001860| 78 20 79 29 29 29 29 0a | 28 66 6f 6f 20 36 29 20 |x y)))).|(foo 6) |
|00001870| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001880| 20 20 20 20 20 20 20 20 | 5c 65 76 20 20 31 30 25 | |\ev 10%|
|00001890| 0a 5c 65 6e 64 7b 73 63 | 68 65 6d 65 7d 0a 0a 5c |.\end{sc|heme}..\|
|000018a0| 68 79 70 65 72 7b 46 6f | 72 6d 61 6c 73 7d 20 73 |hyper{Fo|rmals} s|
|000018b0| 68 6f 75 6c 64 20 68 61 | 76 65 20 6f 6e 65 20 6f |hould ha|ve one o|
|000018c0| 66 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |f the fo|llowing |
|000018d0| 66 6f 72 6d 73 3a 0a 0a | 5c 62 65 67 69 6e 7b 69 |forms:..|\begin{i|
|000018e0| 74 65 6d 69 7a 65 7d 0a | 5c 69 74 65 6d 20 7b 5c |temize}.|\item {\|
|000018f0| 74 74 28 5c 68 79 70 65 | 72 69 7b 76 61 72 69 61 |tt(\hype|ri{varia|
|00001900| 62 6c 65 7d 20 5c 64 6f | 74 73 66 6f 6f 29 7d 3a |ble} \do|tsfoo)}:|
|00001910| 0a 54 68 65 20 70 72 6f | 63 65 64 75 72 65 20 74 |.The pro|cedure t|
|00001920| 61 6b 65 73 20 61 20 66 | 69 78 65 64 20 6e 75 6d |akes a f|ixed num|
|00001930| 62 65 72 20 6f 66 20 61 | 72 67 75 6d 65 6e 74 73 |ber of a|rguments|
|00001940| 3b 20 77 68 65 6e 20 74 | 68 65 20 70 72 6f 63 65 |; when t|he proce|
|00001950| 64 75 72 65 20 69 73 0a | 63 61 6c 6c 65 64 2c 20 |dure is.|called, |
|00001960| 74 68 65 20 61 72 67 75 | 6d 65 6e 74 73 20 77 69 |the argu|ments wi|
|00001970| 6c 6c 20 62 65 20 73 74 | 6f 72 65 64 20 69 6e 20 |ll be st|ored in |
|00001980| 74 68 65 20 62 69 6e 64 | 69 6e 67 73 20 6f 66 20 |the bind|ings of |
|00001990| 74 68 65 0a 63 6f 72 72 | 65 73 70 6f 6e 64 69 6e |the.corr|espondin|
|000019a0| 67 20 76 61 72 69 61 62 | 6c 65 73 2e 0a 0a 5c 69 |g variab|les...\i|
|000019b0| 74 65 6d 20 5c 68 79 70 | 65 72 7b 76 61 72 69 61 |tem \hyp|er{varia|
|000019c0| 62 6c 65 7d 3a 0a 54 68 | 65 20 70 72 6f 63 65 64 |ble}:.Th|e proced|
|000019d0| 75 72 65 20 74 61 6b 65 | 73 20 61 6e 79 20 6e 75 |ure take|s any nu|
|000019e0| 6d 62 65 72 20 6f 66 20 | 61 72 67 75 6d 65 6e 74 |mber of |argument|
|000019f0| 73 3b 20 77 68 65 6e 20 | 74 68 65 20 70 72 6f 63 |s; when |the proc|
|00001a00| 65 64 75 72 65 20 69 73 | 0a 63 61 6c 6c 65 64 2c |edure is|.called,|
|00001a10| 20 74 68 65 20 73 65 71 | 75 65 6e 63 65 20 6f 66 | the seq|uence of|
|00001a20| 20 61 63 74 75 61 6c 20 | 61 72 67 75 6d 65 6e 74 | actual |argument|
|00001a30| 73 20 69 73 20 63 6f 6e | 76 65 72 74 65 64 20 69 |s is con|verted i|
|00001a40| 6e 74 6f 20 61 20 6e 65 | 77 6c 79 0a 61 6c 6c 6f |nto a ne|wly.allo|
|00001a50| 63 61 74 65 64 20 6c 69 | 73 74 2c 20 61 6e 64 20 |cated li|st, and |
|00001a60| 74 68 65 20 6c 69 73 74 | 20 69 73 20 73 74 6f 72 |the list| is stor|
|00001a70| 65 64 20 69 6e 20 74 68 | 65 20 62 69 6e 64 69 6e |ed in th|e bindin|
|00001a80| 67 20 6f 66 20 74 68 65 | 0a 5c 68 79 70 65 72 7b |g of the|.\hyper{|
|00001a90| 76 61 72 69 61 62 6c 65 | 7d 2e 0a 0a 5c 69 74 65 |variable|}...\ite|
|00001aa0| 6d 20 7b 5c 74 74 28 5c | 68 79 70 65 72 69 7b 76 |m {\tt(\|hyperi{v|
|00001ab0| 61 72 69 61 62 6c 65 7d | 20 5c 64 6f 74 73 66 6f |ariable}| \dotsfo|
|00001ac0| 6f 7b 7d 20 5c 68 79 70 | 65 72 7b 76 61 72 69 61 |o{} \hyp|er{varia|
|00001ad0| 62 6c 65 24 5f 7b 6e 2d | 31 7d 24 7d 20 7b 5c 62 |ble$_{n-|1}$} {\b|
|00001ae0| 66 2e 7d 5c 20 5c 68 79 | 70 65 72 6e 7b 76 61 72 |f.}\ \hy|pern{var|
|00001af0| 69 61 62 6c 65 7d 29 7d | 3a 0a 49 66 20 61 20 73 |iable})}|:.If a s|
|00001b00| 70 61 63 65 2d 64 65 6c | 69 6d 69 74 65 64 20 70 |pace-del|imited p|
|00001b10| 65 72 69 6f 64 20 70 72 | 65 63 65 64 65 73 20 74 |eriod pr|ecedes t|
|00001b20| 68 65 20 6c 61 73 74 20 | 76 61 72 69 61 62 6c 65 |he last |variable|
|00001b30| 2c 20 74 68 65 6e 0a 74 | 68 65 20 76 61 6c 75 65 |, then.t|he value|
|00001b40| 20 73 74 6f 72 65 64 20 | 69 6e 20 74 68 65 20 62 | stored |in the b|
|00001b50| 69 6e 64 69 6e 67 20 6f | 66 20 74 68 65 20 6c 61 |inding o|f the la|
|00001b60| 73 74 20 76 61 72 69 61 | 62 6c 65 20 77 69 6c 6c |st varia|ble will|
|00001b70| 20 62 65 20 61 0a 6e 65 | 77 6c 79 20 61 6c 6c 6f | be a.ne|wly allo|
|00001b80| 63 61 74 65 64 0a 6c 69 | 73 74 20 6f 66 20 74 68 |cated.li|st of th|
|00001b90| 65 20 61 63 74 75 61 6c | 20 61 72 67 75 6d 65 6e |e actual| argumen|
|00001ba0| 74 73 20 6c 65 66 74 20 | 6f 76 65 72 20 61 66 74 |ts left |over aft|
|00001bb0| 65 72 20 61 6c 6c 20 74 | 68 65 20 6f 74 68 65 72 |er all t|he other|
|00001bc0| 20 61 63 74 75 61 6c 0a | 61 72 67 75 6d 65 6e 74 | actual.|argument|
|00001bd0| 73 20 68 61 76 65 20 62 | 65 65 6e 20 6d 61 74 63 |s have b|een matc|
|00001be0| 68 65 64 20 75 70 20 61 | 67 61 69 6e 73 74 20 74 |hed up a|gainst t|
|00001bf0| 68 65 20 6f 74 68 65 72 | 20 66 6f 72 6d 61 6c 20 |he other| formal |
|00001c00| 61 72 67 75 6d 65 6e 74 | 73 2e 0a 5c 65 6e 64 7b |argument|s..\end{|
|00001c10| 69 74 65 6d 69 7a 65 7d | 0a 0a 49 74 20 69 73 20 |itemize}|..It is |
|00001c20| 61 6e 20 65 72 72 6f 72 | 20 66 6f 72 20 61 20 5c |an error| for a \|
|00001c30| 68 79 70 65 72 7b 76 61 | 72 69 61 62 6c 65 7d 20 |hyper{va|riable} |
|00001c40| 74 6f 20 61 70 70 65 61 | 72 20 6d 6f 72 65 20 74 |to appea|r more t|
|00001c50| 68 61 6e 20 6f 6e 63 65 | 20 69 6e 0a 5c 68 79 70 |han once| in.\hyp|
|00001c60| 65 72 7b 66 6f 72 6d 61 | 6c 73 7d 2e 0a 0a 5c 62 |er{forma|ls}...\b|
|00001c70| 65 67 69 6e 7b 73 63 68 | 65 6d 65 7d 0a 28 28 6c |egin{sch|eme}.((l|
|00001c80| 61 6d 62 64 61 20 78 20 | 78 29 20 33 20 34 20 35 |ambda x |x) 3 4 5|
|00001c90| 20 36 29 20 20 20 20 20 | 20 20 20 20 20 5c 65 76 | 6) | \ev|
|00001ca0| 20 20 28 33 20 34 20 35 | 20 36 29 0a 28 28 6c 61 | (3 4 5| 6).((la|
|00001cb0| 6d 62 64 61 20 28 78 20 | 79 20 2e 20 7a 29 20 7a |mbda (x |y . z) z|
|00001cc0| 29 0a 20 33 20 34 20 35 | 20 36 29 20 20 20 20 20 |). 3 4 5| 6) |
|00001cd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001ce0| 20 20 5c 65 76 20 20 28 | 35 20 36 29 25 0a 5c 65 | \ev (|5 6)%.\e|
|00001cf0| 6e 64 7b 73 63 68 65 6d | 65 7d 0a 0a 45 61 63 68 |nd{schem|e}..Each|
|00001d00| 20 70 72 6f 63 65 64 75 | 72 65 20 63 72 65 61 74 | procedu|re creat|
|00001d10| 65 64 20 61 73 20 74 68 | 65 20 72 65 73 75 6c 74 |ed as th|e result|
|00001d20| 20 6f 66 20 65 76 61 6c | 75 61 74 69 6e 67 20 61 | of eval|uating a|
|00001d30| 20 5c 6c 61 6d 62 64 61 | 65 78 70 7b 7d 20 69 73 | \lambda|exp{} is|
|00001d40| 20 74 61 67 67 65 64 0a | 77 69 74 68 20 61 20 73 | tagged.|with a s|
|00001d50| 74 6f 72 61 67 65 20 6c | 6f 63 61 74 69 6f 6e 2c |torage l|ocation,|
|00001d60| 20 69 6e 20 6f 72 64 65 | 72 20 74 6f 20 6d 61 6b | in orde|r to mak|
|00001d70| 65 20 5c 69 64 65 7b 65 | 71 76 3f 7d 20 61 6e 64 |e \ide{e|qv?} and|
|00001d80| 0a 5c 69 64 65 7b 65 71 | 3f 7d 20 77 6f 72 6b 20 |.\ide{eq|?} work |
|00001d90| 6f 6e 20 70 72 6f 63 65 | 64 75 72 65 73 20 28 73 |on proce|dures (s|
|00001da0| 65 65 20 73 65 63 74 69 | 6f 6e 7e 5c 72 65 66 7b |ee secti|on~\ref{|
|00001db0| 65 71 75 69 76 61 6c 65 | 6e 63 65 73 65 63 74 69 |equivale|ncesecti|
|00001dc0| 6f 6e 7d 29 2e 0a 0a 5c | 65 6e 64 7b 65 6e 74 72 |on})...\|end{entr|
|00001dd0| 79 7d 0a 0a 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |y}...\su|bsection|
|00001de0| 7b 43 6f 6e 64 69 74 69 | 6f 6e 61 6c 73 7d 5c 75 |{Conditi|onals}\u|
|00001df0| 6e 73 65 63 74 69 6f 6e | 0a 0a 5c 62 65 67 69 6e |nsection|..\begin|
|00001e00| 7b 65 6e 74 72 79 7d 7b | 25 0a 5c 70 72 6f 74 6f |{entry}{|%.\proto|
|00001e10| 7b 69 66 7d 7b 20 5c 68 | 79 70 65 72 7b 74 65 73 |{if}{ \h|yper{tes|
|00001e20| 74 7d 20 5c 68 79 70 65 | 72 7b 63 6f 6e 73 65 71 |t} \hype|r{conseq|
|00001e30| 75 65 6e 74 7d 20 5c 68 | 79 70 65 72 7b 61 6c 74 |uent} \h|yper{alt|
|00001e40| 65 72 6e 61 74 65 7d 7d | 7b 65 73 73 65 6e 74 69 |ernate}}|{essenti|
|00001e50| 61 6c 20 5c 65 78 70 72 | 74 79 70 65 7d 0a 5c 70 |al \expr|type}.\p|
|00001e60| 72 6f 74 6f 7b 69 66 7d | 7b 20 5c 68 79 70 65 72 |roto{if}|{ \hyper|
|00001e70| 7b 74 65 73 74 7d 20 5c | 68 79 70 65 72 7b 63 6f |{test} \|hyper{co|
|00001e80| 6e 73 65 71 75 65 6e 74 | 7d 7d 7b 5c 65 78 70 72 |nsequent|}}{\expr|
|00001e90| 74 79 70 65 7d 7d 20 20 | 25 5c 2f 20 69 66 20 68 |type}} |%\/ if h|
|00001ea0| 79 70 65 72 20 3d 20 69 | 74 61 6c 69 63 0a 0a 5c |yper = i|talic..\|
|00001eb0| 73 79 6e 74 61 78 0a 5c | 68 79 70 65 72 7b 54 65 |syntax.\|hyper{Te|
|00001ec0| 73 74 7d 2c 20 5c 68 79 | 70 65 72 7b 63 6f 6e 73 |st}, \hy|per{cons|
|00001ed0| 65 71 75 65 6e 74 7d 2c | 20 61 6e 64 20 5c 68 79 |equent},| and \hy|
|00001ee0| 70 65 72 7b 61 6c 74 65 | 72 6e 61 74 65 7d 20 6d |per{alte|rnate} m|
|00001ef0| 61 79 20 62 65 20 61 72 | 62 69 74 72 61 72 79 0a |ay be ar|bitrary.|
|00001f00| 65 78 70 72 65 73 73 69 | 6f 6e 73 2e 0a 0a 5c 73 |expressi|ons...\s|
|00001f10| 65 6d 61 6e 74 69 63 73 | 0a 41 6e 20 5c 69 64 65 |emantics|.An \ide|
|00001f20| 7b 69 66 7d 20 65 78 70 | 72 65 73 73 69 6f 6e 20 |{if} exp|ression |
|00001f30| 69 73 20 65 76 61 6c 75 | 61 74 65 64 20 61 73 20 |is evalu|ated as |
|00001f40| 66 6f 6c 6c 6f 77 73 3a | 20 66 69 72 73 74 2c 0a |follows:| first,.|
|00001f50| 5c 68 79 70 65 72 7b 74 | 65 73 74 7d 20 69 73 20 |\hyper{t|est} is |
|00001f60| 65 76 61 6c 75 61 74 65 | 64 2e 20 20 49 66 20 69 |evaluate|d. If i|
|00001f70| 74 20 79 69 65 6c 64 73 | 20 61 20 74 72 75 65 20 |t yields| a true |
|00001f80| 76 61 6c 75 65 5c 69 6e | 64 65 78 7b 74 72 75 65 |value\in|dex{true|
|00001f90| 7d 20 28 73 65 65 0a 73 | 65 63 74 69 6f 6e 7e 5c |} (see.s|ection~\|
|00001fa0| 72 65 66 7b 62 6f 6f 6c | 65 61 6e 73 65 63 74 69 |ref{bool|eansecti|
|00001fb0| 6f 6e 7d 29 2c 20 74 68 | 65 6e 20 5c 68 79 70 65 |on}), th|en \hype|
|00001fc0| 72 7b 63 6f 6e 73 65 71 | 75 65 6e 74 7d 20 69 73 |r{conseq|uent} is|
|00001fd0| 20 65 76 61 6c 75 61 74 | 65 64 20 61 6e 64 0a 69 | evaluat|ed and.i|
|00001fe0| 74 73 20 76 61 6c 75 65 | 20 69 73 20 72 65 74 75 |ts value| is retu|
|00001ff0| 72 6e 65 64 2e 20 20 4f | 74 68 65 72 77 69 73 65 |rned. O|therwise|
|00002000| 20 5c 68 79 70 65 72 7b | 61 6c 74 65 72 6e 61 74 | \hyper{|alternat|
|00002010| 65 7d 20 69 73 20 65 76 | 61 6c 75 61 74 65 64 20 |e} is ev|aluated |
|00002020| 61 6e 64 20 69 74 73 0a | 76 61 6c 75 65 20 69 73 |and its.|value is|
|00002030| 20 72 65 74 75 72 6e 65 | 64 2e 20 20 49 66 20 5c | returne|d. If \|
|00002040| 68 79 70 65 72 7b 74 65 | 73 74 7d 20 79 69 65 6c |hyper{te|st} yiel|
|00002050| 64 73 20 61 20 66 61 6c | 73 65 20 76 61 6c 75 65 |ds a fal|se value|
|00002060| 20 61 6e 64 20 6e 6f 0a | 5c 68 79 70 65 72 7b 61 | and no.|\hyper{a|
|00002070| 6c 74 65 72 6e 61 74 65 | 7d 20 69 73 20 73 70 65 |lternate|} is spe|
|00002080| 63 69 66 69 65 64 2c 20 | 74 68 65 6e 20 74 68 65 |cified, |then the|
|00002090| 20 72 65 73 75 6c 74 20 | 6f 66 20 74 68 65 20 65 | result |of the e|
|000020a0| 78 70 72 65 73 73 69 6f | 6e 20 69 73 0a 75 6e 73 |xpressio|n is.uns|
|000020b0| 70 65 63 69 66 69 65 64 | 2e 0a 0a 5c 62 65 67 69 |pecified|...\begi|
|000020c0| 6e 7b 73 63 68 65 6d 65 | 7d 0a 28 69 66 20 28 3e |n{scheme|}.(if (>|
|000020d0| 20 33 20 32 29 20 27 79 | 65 73 20 27 6e 6f 29 20 | 3 2) 'y|es 'no) |
|000020e0| 20 20 20 20 20 20 20 20 | 20 20 5c 65 76 20 20 79 | | \ev y|
|000020f0| 65 73 0a 28 69 66 20 28 | 3e 20 32 20 33 29 20 27 |es.(if (|> 2 3) '|
|00002100| 79 65 73 20 27 6e 6f 29 | 20 20 20 20 20 20 20 20 |yes 'no)| |
|00002110| 20 20 20 5c 65 76 20 20 | 6e 6f 0a 28 69 66 20 28 | \ev |no.(if (|
|00002120| 3e 20 33 20 32 29 0a 20 | 20 20 20 28 2d 20 33 20 |> 3 2). | (- 3 |
|00002130| 32 29 0a 20 20 20 20 28 | 2b 20 33 20 32 29 29 20 |2). (|+ 3 2)) |
|00002140| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002150| 20 20 20 5c 65 76 20 20 | 31 25 0a 5c 65 6e 64 7b | \ev |1%.\end{|
|00002160| 73 63 68 65 6d 65 7d 0a | 0a 5c 65 6e 64 7b 65 6e |scheme}.|.\end{en|
|00002170| 74 72 79 7d 0a 0a 0a 5c | 73 75 62 73 65 63 74 69 |try}...\|subsecti|
|00002180| 6f 6e 7b 41 73 73 69 67 | 6e 6d 65 6e 74 73 7d 5c |on{Assig|nments}\|
|00002190| 75 6e 73 65 63 74 69 6f | 6e 0a 0a 5c 62 65 67 69 |unsectio|n..\begi|
|000021a0| 6e 7b 65 6e 74 72 79 7d | 7b 25 0a 5c 70 72 6f 74 |n{entry}|{%.\prot|
|000021b0| 6f 7b 73 65 74 21 7d 7b | 20 5c 68 79 70 65 72 7b |o{set!}{| \hyper{|
|000021c0| 76 61 72 69 61 62 6c 65 | 7d 20 5c 68 79 70 65 72 |variable|} \hyper|
|000021d0| 7b 65 78 70 72 65 73 73 | 69 6f 6e 7d 7d 7b 65 73 |{express|ion}}{es|
|000021e0| 73 65 6e 74 69 61 6c 20 | 5c 65 78 70 72 74 79 70 |sential |\exprtyp|
|000021f0| 65 7d 7d 0a 0a 5c 68 79 | 70 65 72 7b 45 78 70 72 |e}}..\hy|per{Expr|
|00002200| 65 73 73 69 6f 6e 7d 20 | 69 73 20 65 76 61 6c 75 |ession} |is evalu|
|00002210| 61 74 65 64 2c 20 61 6e | 64 20 74 68 65 20 72 65 |ated, an|d the re|
|00002220| 73 75 6c 74 69 6e 67 20 | 76 61 6c 75 65 20 69 73 |sulting |value is|
|00002230| 20 73 74 6f 72 65 64 20 | 69 6e 0a 74 68 65 20 6c | stored |in.the l|
|00002240| 6f 63 61 74 69 6f 6e 20 | 74 6f 20 77 68 69 63 68 |ocation |to which|
|00002250| 20 5c 68 79 70 65 72 7b | 76 61 72 69 61 62 6c 65 | \hyper{|variable|
|00002260| 7d 20 69 73 20 62 6f 75 | 6e 64 2e 20 20 5c 68 79 |} is bou|nd. \hy|
|00002270| 70 65 72 7b 56 61 72 69 | 61 62 6c 65 7d 20 6d 75 |per{Vari|able} mu|
|00002280| 73 74 0a 62 65 20 62 6f | 75 6e 64 20 65 69 74 68 |st.be bo|und eith|
|00002290| 65 72 20 69 6e 20 73 6f | 6d 65 20 72 65 67 69 6f |er in so|me regio|
|000022a0| 6e 5c 69 6e 64 65 78 7b | 72 65 67 69 6f 6e 7d 20 |n\index{|region} |
|000022b0| 65 6e 63 6c 6f 73 69 6e | 67 20 74 68 65 20 5c 69 |enclosin|g the \i|
|000022c0| 64 65 7b 73 65 74 21 7d | 5c 20 65 78 70 72 65 73 |de{set!}|\ expres|
|000022d0| 73 69 6f 6e 0a 6f 72 20 | 61 74 20 74 6f 70 20 6c |sion.or |at top l|
|000022e0| 65 76 65 6c 2e 20 20 54 | 68 65 20 72 65 73 75 6c |evel. T|he resul|
|000022f0| 74 20 6f 66 20 74 68 65 | 20 5c 69 64 65 7b 73 65 |t of the| \ide{se|
|00002300| 74 21 7d 20 65 78 70 72 | 65 73 73 69 6f 6e 20 69 |t!} expr|ession i|
|00002310| 73 0a 75 6e 73 70 65 63 | 69 66 69 65 64 2e 0a 0a |s.unspec|ified...|
|00002320| 5c 62 65 67 69 6e 7b 73 | 63 68 65 6d 65 7d 0a 28 |\begin{s|cheme}.(|
|00002330| 64 65 66 69 6e 65 20 78 | 20 32 29 0a 28 2b 20 78 |define x| 2).(+ x|
|00002340| 20 31 29 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | 1) | |
|00002350| 20 20 20 20 5c 65 76 20 | 20 33 0a 28 73 65 74 21 | \ev | 3.(set!|
|00002360| 20 78 20 34 29 20 20 20 | 20 20 20 20 20 20 20 20 | x 4) | |
|00002370| 20 20 20 5c 65 76 20 20 | 5c 75 6e 73 70 65 63 69 | \ev |\unspeci|
|00002380| 66 69 65 64 0a 28 2b 20 | 78 20 31 29 20 20 20 20 |fied.(+ |x 1) |
|00002390| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 5c 65 76 | | \ev|
|000023a0| 20 20 35 25 0a 5c 65 6e | 64 7b 73 63 68 65 6d 65 | 5%.\en|d{scheme|
|000023b0| 7d 0a 0a 5c 65 6e 64 7b | 65 6e 74 72 79 7d 0a 0a |}..\end{|entry}..|
|000023c0| 0a 5c 73 65 63 74 69 6f | 6e 7b 44 65 72 69 76 65 |.\sectio|n{Derive|
|000023d0| 64 20 65 78 70 72 65 73 | 73 69 6f 6e 20 74 79 70 |d expres|sion typ|
|000023e0| 65 73 7d 0a 0a 46 6f 72 | 20 72 65 66 65 72 65 6e |es}..For| referen|
|000023f0| 63 65 20 70 75 72 70 6f | 73 65 73 2c 20 73 65 63 |ce purpo|ses, sec|
|00002400| 74 69 6f 6e 7e 5c 72 65 | 66 7b 64 65 72 69 76 65 |tion~\re|f{derive|
|00002410| 64 73 65 63 74 69 6f 6e | 7d 20 67 69 76 65 73 20 |dsection|} gives |
|00002420| 72 65 77 72 69 74 65 20 | 72 75 6c 65 73 0a 74 68 |rewrite |rules.th|
|00002430| 61 74 20 77 69 6c 6c 20 | 63 6f 6e 76 65 72 74 20 |at will |convert |
|00002440| 63 6f 6e 73 74 72 75 63 | 74 73 20 64 65 73 63 72 |construc|ts descr|
|00002450| 69 62 65 64 20 69 6e 20 | 74 68 69 73 20 73 65 63 |ibed in |this sec|
|00002460| 74 69 6f 6e 20 69 6e 74 | 6f 20 74 68 65 0a 70 72 |tion int|o the.pr|
|00002470| 69 6d 69 74 69 76 65 20 | 63 6f 6e 73 74 72 75 63 |imitive |construc|
|00002480| 74 73 20 64 65 73 63 72 | 69 62 65 64 20 69 6e 20 |ts descr|ibed in |
|00002490| 74 68 65 20 70 72 65 76 | 69 6f 75 73 20 73 65 63 |the prev|ious sec|
|000024a0| 74 69 6f 6e 2e 0a 0a 0a | 5c 73 75 62 73 65 63 74 |tion....|\subsect|
|000024b0| 69 6f 6e 7b 43 6f 6e 64 | 69 74 69 6f 6e 61 6c 73 |ion{Cond|itionals|
|000024c0| 7d 5c 75 6e 73 65 63 74 | 69 6f 6e 0a 0a 5c 62 65 |}\unsect|ion..\be|
|000024d0| 67 69 6e 7b 65 6e 74 72 | 79 7d 7b 25 0a 5c 70 72 |gin{entr|y}{%.\pr|
|000024e0| 6f 74 6f 7b 63 6f 6e 64 | 7d 7b 20 5c 68 79 70 65 |oto{cond|}{ \hype|
|000024f0| 72 69 7b 63 6c 61 75 73 | 65 7d 20 5c 68 79 70 65 |ri{claus|e} \hype|
|00002500| 72 69 69 7b 63 6c 61 75 | 73 65 7d 20 5c 64 6f 74 |rii{clau|se} \dot|
|00002510| 73 66 6f 6f 7d 7b 65 73 | 73 65 6e 74 69 61 6c 20 |sfoo}{es|sential |
|00002520| 5c 65 78 70 72 74 79 70 | 65 7d 7d 0a 0a 5c 73 79 |\exprtyp|e}}..\sy|
|00002530| 6e 74 61 78 0a 45 61 63 | 68 20 5c 68 79 70 65 72 |ntax.Eac|h \hyper|
|00002540| 7b 63 6c 61 75 73 65 7d | 20 73 68 6f 75 6c 64 20 |{clause}| should |
|00002550| 62 65 20 6f 66 20 74 68 | 65 20 66 6f 72 6d 0a 5c |be of th|e form.\|
|00002560| 62 65 67 69 6e 7b 73 63 | 68 65 6d 65 7d 0a 28 5c |begin{sc|heme}.(\|
|00002570| 68 79 70 65 72 7b 74 65 | 73 74 7d 20 5c 68 79 70 |hyper{te|st} \hyp|
|00002580| 65 72 7b 65 78 70 72 65 | 73 73 69 6f 6e 7d 20 5c |er{expre|ssion} \|
|00002590| 64 6f 74 73 66 6f 6f 29 | 25 0a 5c 65 6e 64 7b 73 |dotsfoo)|%.\end{s|
|000025a0| 63 68 65 6d 65 7d 0a 77 | 68 65 72 65 20 5c 68 79 |cheme}.w|here \hy|
|000025b0| 70 65 72 7b 74 65 73 74 | 7d 20 69 73 20 61 6e 79 |per{test|} is any|
|000025c0| 20 65 78 70 72 65 73 73 | 69 6f 6e 2e 20 20 54 68 | express|ion. Th|
|000025d0| 65 20 6c 61 73 74 20 5c | 68 79 70 65 72 7b 63 6c |e last \|hyper{cl|
|000025e0| 61 75 73 65 7d 20 6d 61 | 79 20 62 65 0a 61 6e 20 |ause} ma|y be.an |
|000025f0| 60 60 65 6c 73 65 20 63 | 6c 61 75 73 65 2c 27 27 |``else c|lause,''|
|00002600| 20 77 68 69 63 68 20 68 | 61 73 20 74 68 65 20 66 | which h|as the f|
|00002610| 6f 72 6d 0a 5c 62 65 67 | 69 6e 7b 73 63 68 65 6d |orm.\beg|in{schem|
|00002620| 65 7d 0a 28 65 6c 73 65 | 20 5c 68 79 70 65 72 69 |e}.(else| \hyperi|
|00002630| 7b 65 78 70 72 65 73 73 | 69 6f 6e 7d 20 5c 68 79 |{express|ion} \hy|
|00002640| 70 65 72 69 69 7b 65 78 | 70 72 65 73 73 69 6f 6e |perii{ex|pression|
|00002650| 7d 20 5c 64 6f 74 73 66 | 6f 6f 29 5c 72 6d 2e 25 |} \dotsf|oo)\rm.%|
|00002660| 0a 5c 65 6e 64 7b 73 63 | 68 65 6d 65 7d 0a 5c 6d |.\end{sc|heme}.\m|
|00002670| 61 69 6e 73 63 68 69 6e | 64 65 78 7b 65 6c 73 65 |ainschin|dex{else|
|00002680| 7d 0a 5c 6d 61 69 6e 73 | 63 68 69 6e 64 65 78 7b |}.\mains|chindex{|
|00002690| 3d 3e 7d 0a 0a 5c 73 65 | 6d 61 6e 74 69 63 73 0a |=>}..\se|mantics.|
|000026a0| 41 20 5c 69 64 65 7b 63 | 6f 6e 64 7d 20 65 78 70 |A \ide{c|ond} exp|
|000026b0| 72 65 73 73 69 6f 6e 20 | 69 73 20 65 76 61 6c 75 |ression |is evalu|
|000026c0| 61 74 65 64 20 62 79 20 | 65 76 61 6c 75 61 74 69 |ated by |evaluati|
|000026d0| 6e 67 20 74 68 65 20 5c | 68 79 70 65 72 7b 74 65 |ng the \|hyper{te|
|000026e0| 73 74 7d 0a 65 78 70 72 | 65 73 73 69 6f 6e 73 20 |st}.expr|essions |
|000026f0| 6f 66 20 73 75 63 63 65 | 73 73 69 76 65 20 5c 68 |of succe|ssive \h|
|00002700| 79 70 65 72 7b 63 6c 61 | 75 73 65 7d 73 20 69 6e |yper{cla|use}s in|
|00002710| 20 6f 72 64 65 72 20 75 | 6e 74 69 6c 20 6f 6e 65 | order u|ntil one|
|00002720| 20 6f 66 20 74 68 65 6d | 0a 65 76 61 6c 75 61 74 | of them|.evaluat|
|00002730| 65 73 20 74 6f 20 61 20 | 74 72 75 65 20 76 61 6c |es to a |true val|
|00002740| 75 65 5c 69 6e 64 65 78 | 7b 74 72 75 65 7d 20 28 |ue\index|{true} (|
|00002750| 73 65 65 0a 73 65 63 74 | 69 6f 6e 7e 5c 72 65 66 |see.sect|ion~\ref|
|00002760| 7b 62 6f 6f 6c 65 61 6e | 73 65 63 74 69 6f 6e 7d |{boolean|section}|
|00002770| 29 2e 20 20 57 68 65 6e | 20 61 20 5c 68 79 70 65 |). When| a \hype|
|00002780| 72 7b 74 65 73 74 7d 20 | 65 76 61 6c 75 61 74 65 |r{test} |evaluate|
|00002790| 73 20 74 6f 20 61 20 74 | 72 75 65 0a 76 61 6c 75 |s to a t|rue.valu|
|000027a0| 65 2c 20 74 68 65 6e 20 | 74 68 65 20 72 65 6d 61 |e, then |the rema|
|000027b0| 69 6e 69 6e 67 20 5c 68 | 79 70 65 72 7b 65 78 70 |ining \h|yper{exp|
|000027c0| 72 65 73 73 69 6f 6e 7d | 73 20 69 6e 20 69 74 73 |ression}|s in its|
|000027d0| 20 5c 68 79 70 65 72 7b | 63 6c 61 75 73 65 7d 20 | \hyper{|clause} |
|000027e0| 61 72 65 0a 65 76 61 6c | 75 61 74 65 64 20 69 6e |are.eval|uated in|
|000027f0| 20 6f 72 64 65 72 2c 20 | 61 6e 64 20 74 68 65 20 | order, |and the |
|00002800| 72 65 73 75 6c 74 20 6f | 66 20 74 68 65 20 6c 61 |result o|f the la|
|00002810| 73 74 20 5c 68 79 70 65 | 72 7b 65 78 70 72 65 73 |st \hype|r{expres|
|00002820| 73 69 6f 6e 7d 20 69 6e | 20 74 68 65 0a 5c 68 79 |sion} in| the.\hy|
|00002830| 70 65 72 7b 63 6c 61 75 | 73 65 7d 20 69 73 20 72 |per{clau|se} is r|
|00002840| 65 74 75 72 6e 65 64 20 | 61 73 20 74 68 65 20 72 |eturned |as the r|
|00002850| 65 73 75 6c 74 20 6f 66 | 20 74 68 65 20 65 6e 74 |esult of| the ent|
|00002860| 69 72 65 20 5c 69 64 65 | 7b 63 6f 6e 64 7d 0a 65 |ire \ide|{cond}.e|
|00002870| 78 70 72 65 73 73 69 6f | 6e 2e 20 20 49 66 20 74 |xpressio|n. If t|
|00002880| 68 65 20 73 65 6c 65 63 | 74 65 64 20 5c 68 79 70 |he selec|ted \hyp|
|00002890| 65 72 7b 63 6c 61 75 73 | 65 7d 20 63 6f 6e 74 61 |er{claus|e} conta|
|000028a0| 69 6e 73 20 6f 6e 6c 79 | 20 74 68 65 0a 5c 68 79 |ins only| the.\hy|
|000028b0| 70 65 72 7b 74 65 73 74 | 7d 20 61 6e 64 20 6e 6f |per{test|} and no|
|000028c0| 20 5c 68 79 70 65 72 7b | 65 78 70 72 65 73 73 69 | \hyper{|expressi|
|000028d0| 6f 6e 7d 73 2c 20 74 68 | 65 6e 20 74 68 65 20 76 |on}s, th|en the v|
|000028e0| 61 6c 75 65 20 6f 66 20 | 74 68 65 0a 5c 68 79 70 |alue of |the.\hyp|
|000028f0| 65 72 7b 74 65 73 74 7d | 20 69 73 20 72 65 74 75 |er{test}| is retu|
|00002900| 72 6e 65 64 20 61 73 20 | 74 68 65 20 72 65 73 75 |rned as |the resu|
|00002910| 6c 74 2e 20 20 49 66 20 | 61 6c 6c 20 5c 68 79 70 |lt. If |all \hyp|
|00002920| 65 72 7b 74 65 73 74 7d | 73 20 65 76 61 6c 75 61 |er{test}|s evalua|
|00002930| 74 65 0a 74 6f 20 66 61 | 6c 73 65 20 76 61 6c 75 |te.to fa|lse valu|
|00002940| 65 73 2c 20 61 6e 64 20 | 74 68 65 72 65 20 69 73 |es, and |there is|
|00002950| 20 6e 6f 20 65 6c 73 65 | 20 63 6c 61 75 73 65 2c | no else| clause,|
|00002960| 20 74 68 65 6e 20 74 68 | 65 20 72 65 73 75 6c 74 | then th|e result|
|00002970| 20 6f 66 0a 74 68 65 20 | 63 6f 6e 64 69 74 69 6f | of.the |conditio|
|00002980| 6e 61 6c 20 65 78 70 72 | 65 73 73 69 6f 6e 20 69 |nal expr|ession i|
|00002990| 73 20 75 6e 73 70 65 63 | 69 66 69 65 64 3b 20 69 |s unspec|ified; i|
|000029a0| 66 20 74 68 65 72 65 20 | 69 73 20 61 6e 20 65 6c |f there |is an el|
|000029b0| 73 65 0a 63 6c 61 75 73 | 65 2c 20 74 68 65 6e 20 |se.claus|e, then |
|000029c0| 69 74 73 20 5c 68 79 70 | 65 72 7b 65 78 70 72 65 |its \hyp|er{expre|
|000029d0| 73 73 69 6f 6e 7d 73 20 | 61 72 65 20 65 76 61 6c |ssion}s |are eval|
|000029e0| 75 61 74 65 64 2c 20 61 | 6e 64 20 74 68 65 20 76 |uated, a|nd the v|
|000029f0| 61 6c 75 65 20 6f 66 0a | 74 68 65 20 6c 61 73 74 |alue of.|the last|
|00002a00| 20 6f 6e 65 20 69 73 20 | 72 65 74 75 72 6e 65 64 | one is |returned|
|00002a10| 2e 0a 0a 5c 62 65 67 69 | 6e 7b 73 63 68 65 6d 65 |...\begi|n{scheme|
|00002a20| 7d 0a 28 63 6f 6e 64 20 | 28 28 3e 20 33 20 32 29 |}.(cond |((> 3 2)|
|00002a30| 20 27 67 72 65 61 74 65 | 72 29 0a 20 20 20 20 20 | 'greate|r). |
|00002a40| 20 28 28 3c 20 33 20 32 | 29 20 27 6c 65 73 73 29 | ((< 3 2|) 'less)|
|00002a50| 29 20 20 20 20 20 20 20 | 20 20 5c 65 76 20 20 67 |) | \ev g|
|00002a60| 72 65 61 74 65 72 25 0a | 0a 28 63 6f 6e 64 20 28 |reater%.|.(cond (|
|00002a70| 28 3e 20 33 20 33 29 20 | 27 67 72 65 61 74 65 72 |(> 3 3) |'greater|
|00002a80| 29 0a 20 20 20 20 20 20 | 28 28 3c 20 33 20 33 29 |). |((< 3 3)|
|00002a90| 20 27 6c 65 73 73 29 0a | 20 20 20 20 20 20 28 65 | 'less).| (e|
|00002aa0| 6c 73 65 20 27 65 71 75 | 61 6c 29 29 20 20 20 20 |lse 'equ|al)) |
|00002ab0| 20 20 20 20 20 20 20 20 | 5c 65 76 20 20 65 71 75 | |\ev equ|
|00002ac0| 61 6c 25 0a 5c 65 6e 64 | 7b 73 63 68 65 6d 65 7d |al%.\end|{scheme}|
|00002ad0| 0a 0a 53 6f 6d 65 20 69 | 6d 70 6c 65 6d 65 6e 74 |..Some i|mplement|
|00002ae0| 61 74 69 6f 6e 73 20 73 | 75 70 70 6f 72 74 20 61 |ations s|upport a|
|00002af0| 6e 20 61 6c 74 65 72 6e | 61 74 69 76 65 20 5c 68 |n altern|ative \h|
|00002b00| 79 70 65 72 7b 63 6c 61 | 75 73 65 7d 20 73 79 6e |yper{cla|use} syn|
|00002b10| 74 61 78 2c 0a 7b 5c 74 | 74 28 5c 68 79 70 65 72 |tax,.{\t|t(\hyper|
|00002b20| 7b 74 65 73 74 7d 20 3d | 3e 20 5c 68 79 70 65 72 |{test} =|> \hyper|
|00002b30| 7b 72 65 63 69 70 69 65 | 6e 74 7d 29 7d 2c 20 77 |{recipie|nt})}, w|
|00002b40| 68 65 72 65 20 5c 68 79 | 70 65 72 7b 72 65 63 69 |here \hy|per{reci|
|00002b50| 70 69 65 6e 74 7d 20 69 | 73 20 61 6e 0a 65 78 70 |pient} i|s an.exp|
|00002b60| 72 65 73 73 69 6f 6e 2e | 20 20 49 66 20 5c 68 79 |ression.| If \hy|
|00002b70| 70 65 72 7b 74 65 73 74 | 7d 20 65 76 61 6c 75 61 |per{test|} evalua|
|00002b80| 74 65 73 20 74 6f 20 61 | 20 74 72 75 65 20 76 61 |tes to a| true va|
|00002b90| 6c 75 65 2c 20 74 68 65 | 6e 0a 5c 68 79 70 65 72 |lue, the|n.\hyper|
|00002ba0| 7b 72 65 63 69 70 69 65 | 6e 74 7d 20 69 73 20 65 |{recipie|nt} is e|
|00002bb0| 76 61 6c 75 61 74 65 64 | 2e 20 20 49 74 73 20 76 |valuated|. Its v|
|00002bc0| 61 6c 75 65 20 6d 75 73 | 74 20 62 65 20 61 20 70 |alue mus|t be a p|
|00002bd0| 72 6f 63 65 64 75 72 65 | 20 6f 66 20 6f 6e 65 0a |rocedure| of one.|
|00002be0| 61 72 67 75 6d 65 6e 74 | 3b 20 74 68 69 73 20 70 |argument|; this p|
|00002bf0| 72 6f 63 65 64 75 72 65 | 20 69 73 20 74 68 65 6e |rocedure| is then|
|00002c00| 20 69 6e 76 6f 6b 65 64 | 20 6f 6e 20 74 68 65 20 | invoked| on the |
|00002c10| 76 61 6c 75 65 20 6f 66 | 20 74 68 65 0a 5c 68 79 |value of| the.\hy|
|00002c20| 70 65 72 7b 74 65 73 74 | 7d 2e 0a 0a 5c 62 65 67 |per{test|}...\beg|
|00002c30| 69 6e 7b 73 63 68 65 6d | 65 7d 0a 28 63 6f 6e 64 |in{schem|e}.(cond|
|00002c40| 20 28 28 61 73 73 76 20 | 27 62 20 27 28 28 61 20 | ((assv |'b '((a |
|00002c50| 31 29 20 28 62 20 32 29 | 29 29 20 3d 3e 20 63 61 |1) (b 2)|)) => ca|
|00002c60| 64 72 29 0a 20 20 20 20 | 20 20 28 65 6c 73 65 20 |dr). | (else |
|00002c70| 5c 73 63 68 66 61 6c 73 | 65 7b 7d 29 29 20 20 20 |\schfals|e{})) |
|00002c80| 20 20 20 20 20 20 5c 65 | 76 20 20 32 25 0a 5c 65 | \e|v 2%.\e|
|00002c90| 6e 64 7b 73 63 68 65 6d | 65 7d 0a 0a 0a 5c 65 6e |nd{schem|e}...\en|
|00002ca0| 64 7b 65 6e 74 72 79 7d | 0a 0a 0a 5c 62 65 67 69 |d{entry}|...\begi|
|00002cb0| 6e 7b 65 6e 74 72 79 7d | 7b 25 0a 5c 70 72 6f 74 |n{entry}|{%.\prot|
|00002cc0| 6f 7b 63 61 73 65 7d 7b | 20 5c 68 79 70 65 72 7b |o{case}{| \hyper{|
|00002cd0| 6b 65 79 7d 20 5c 68 79 | 70 65 72 69 7b 63 6c 61 |key} \hy|peri{cla|
|00002ce0| 75 73 65 7d 20 5c 68 79 | 70 65 72 69 69 7b 63 6c |use} \hy|perii{cl|
|00002cf0| 61 75 73 65 7d 20 5c 64 | 6f 74 73 66 6f 6f 7d 7b |ause} \d|otsfoo}{|
|00002d00| 65 73 73 65 6e 74 69 61 | 6c 20 5c 65 78 70 72 74 |essentia|l \exprt|
|00002d10| 79 70 65 7d 7d 0a 0a 5c | 73 79 6e 74 61 78 0a 5c |ype}}..\|syntax.\|
|00002d20| 68 79 70 65 72 7b 4b 65 | 79 7d 20 6d 61 79 20 62 |hyper{Ke|y} may b|
|00002d30| 65 20 61 6e 79 20 65 78 | 70 72 65 73 73 69 6f 6e |e any ex|pression|
|00002d40| 2e 20 20 45 61 63 68 20 | 5c 68 79 70 65 72 7b 63 |. Each |\hyper{c|
|00002d50| 6c 61 75 73 65 7d 20 73 | 68 6f 75 6c 64 20 68 61 |lause} s|hould ha|
|00002d60| 76 65 0a 74 68 65 20 66 | 6f 72 6d 0a 5c 62 65 67 |ve.the f|orm.\beg|
|00002d70| 69 6e 7b 73 63 68 65 6d | 65 7d 0a 28 28 5c 68 79 |in{schem|e}.((\hy|
|00002d80| 70 65 72 69 7b 64 61 74 | 75 6d 7d 20 5c 64 6f 74 |peri{dat|um} \dot|
|00002d90| 73 66 6f 6f 29 20 5c 68 | 79 70 65 72 69 7b 65 78 |sfoo) \h|yperi{ex|
|00002da0| 70 72 65 73 73 69 6f 6e | 7d 20 5c 68 79 70 65 72 |pression|} \hyper|
|00002db0| 69 69 7b 65 78 70 72 65 | 73 73 69 6f 6e 7d 20 5c |ii{expre|ssion} \|
|00002dc0| 64 6f 74 73 66 6f 6f 29 | 5c 72 6d 2c 25 0a 5c 65 |dotsfoo)|\rm,%.\e|
|00002dd0| 6e 64 7b 73 63 68 65 6d | 65 7d 0a 77 68 65 72 65 |nd{schem|e}.where|
|00002de0| 20 65 61 63 68 20 5c 68 | 79 70 65 72 7b 64 61 74 | each \h|yper{dat|
|00002df0| 75 6d 7d 20 69 73 20 61 | 6e 20 65 78 74 65 72 6e |um} is a|n extern|
|00002e00| 61 6c 20 72 65 70 72 65 | 73 65 6e 74 61 74 69 6f |al repre|sentatio|
|00002e10| 6e 20 6f 66 20 73 6f 6d | 65 20 6f 62 6a 65 63 74 |n of som|e object|
|00002e20| 2e 0a 41 6c 6c 20 74 68 | 65 20 5c 68 79 70 65 72 |..All th|e \hyper|
|00002e30| 7b 64 61 74 75 6d 7d 73 | 20 6d 75 73 74 20 62 65 |{datum}s| must be|
|00002e40| 20 64 69 73 74 69 6e 63 | 74 2e 0a 54 68 65 20 6c | distinc|t..The l|
|00002e50| 61 73 74 20 5c 68 79 70 | 65 72 7b 63 6c 61 75 73 |ast \hyp|er{claus|
|00002e60| 65 7d 20 6d 61 79 20 62 | 65 20 61 6e 20 60 60 65 |e} may b|e an ``e|
|00002e70| 6c 73 65 20 63 6c 61 75 | 73 65 2c 27 27 20 77 68 |lse clau|se,'' wh|
|00002e80| 69 63 68 20 68 61 73 20 | 74 68 65 20 66 6f 72 6d |ich has |the form|
|00002e90| 0a 5c 62 65 67 69 6e 7b | 73 63 68 65 6d 65 7d 0a |.\begin{|scheme}.|
|00002ea0| 28 65 6c 73 65 20 5c 68 | 79 70 65 72 69 7b 65 78 |(else \h|yperi{ex|
|00002eb0| 70 72 65 73 73 69 6f 6e | 7d 20 5c 68 79 70 65 72 |pression|} \hyper|
|00002ec0| 69 69 7b 65 78 70 72 65 | 73 73 69 6f 6e 7d 20 5c |ii{expre|ssion} \|
|00002ed0| 64 6f 74 73 66 6f 6f 29 | 5c 72 6d 2e 25 0a 5c 65 |dotsfoo)|\rm.%.\e|
|00002ee0| 6e 64 7b 73 63 68 65 6d | 65 7d 0a 5c 73 63 68 69 |nd{schem|e}.\schi|
|00002ef0| 6e 64 65 78 7b 65 6c 73 | 65 7d 0a 0a 5c 73 65 6d |ndex{els|e}..\sem|
|00002f00| 61 6e 74 69 63 73 0a 41 | 20 5c 69 64 65 7b 63 61 |antics.A| \ide{ca|
|00002f10| 73 65 7d 20 65 78 70 72 | 65 73 73 69 6f 6e 20 69 |se} expr|ession i|
|00002f20| 73 20 65 76 61 6c 75 61 | 74 65 64 20 61 73 20 66 |s evalua|ted as f|
|00002f30| 6f 6c 6c 6f 77 73 2e 20 | 20 5c 68 79 70 65 72 7b |ollows. | \hyper{|
|00002f40| 4b 65 79 7d 20 69 73 0a | 65 76 61 6c 75 61 74 65 |Key} is.|evaluate|
|00002f50| 64 20 61 6e 64 20 69 74 | 73 20 72 65 73 75 6c 74 |d and it|s result|
|00002f60| 20 69 73 20 63 6f 6d 70 | 61 72 65 64 20 61 67 61 | is comp|ared aga|
|00002f70| 69 6e 73 74 20 65 61 63 | 68 20 5c 68 79 70 65 72 |inst eac|h \hyper|
|00002f80| 7b 64 61 74 75 6d 7d 2e | 20 20 49 66 20 74 68 65 |{datum}.| If the|
|00002f90| 0a 72 65 73 75 6c 74 20 | 6f 66 20 65 76 61 6c 75 |.result |of evalu|
|00002fa0| 61 74 69 6e 67 20 5c 68 | 79 70 65 72 7b 6b 65 79 |ating \h|yper{key|
|00002fb0| 7d 20 69 73 20 65 71 75 | 69 76 61 6c 65 6e 74 20 |} is equ|ivalent |
|00002fc0| 28 69 6e 20 74 68 65 20 | 73 65 6e 73 65 20 6f 66 |(in the |sense of|
|00002fd0| 0a 5c 69 64 65 7b 65 71 | 76 3f 7d 3b 20 73 65 65 |.\ide{eq|v?}; see|
|00002fe0| 20 73 65 63 74 69 6f 6e | 7e 5c 72 65 66 7b 65 71 | section|~\ref{eq|
|00002ff0| 76 3f 7d 29 20 74 6f 20 | 61 20 5c 68 79 70 65 72 |v?}) to |a \hyper|
|00003000| 7b 64 61 74 75 6d 7d 2c | 20 74 68 65 6e 20 74 68 |{datum},| then th|
|00003010| 65 0a 65 78 70 72 65 73 | 73 69 6f 6e 73 20 69 6e |e.expres|sions in|
|00003020| 20 74 68 65 20 63 6f 72 | 72 65 73 70 6f 6e 64 69 | the cor|respondi|
|00003030| 6e 67 20 5c 68 79 70 65 | 72 7b 63 6c 61 75 73 65 |ng \hype|r{clause|
|00003040| 7d 20 61 72 65 20 65 76 | 61 6c 75 61 74 65 64 20 |} are ev|aluated |
|00003050| 66 72 6f 6d 20 6c 65 66 | 74 0a 74 6f 20 72 69 67 |from lef|t.to rig|
|00003060| 68 74 20 61 6e 64 20 74 | 68 65 20 72 65 73 75 6c |ht and t|he resul|
|00003070| 74 20 6f 66 20 74 68 65 | 20 6c 61 73 74 20 65 78 |t of the| last ex|
|00003080| 70 72 65 73 73 69 6f 6e | 20 69 6e 20 74 68 65 20 |pression| in the |
|00003090| 5c 68 79 70 65 72 7b 63 | 6c 61 75 73 65 7d 20 69 |\hyper{c|lause} i|
|000030a0| 73 0a 72 65 74 75 72 6e | 65 64 20 61 73 20 74 68 |s.return|ed as th|
|000030b0| 65 20 72 65 73 75 6c 74 | 20 6f 66 20 74 68 65 20 |e result| of the |
|000030c0| 5c 69 64 65 7b 63 61 73 | 65 7d 20 65 78 70 72 65 |\ide{cas|e} expre|
|000030d0| 73 73 69 6f 6e 2e 20 20 | 49 66 20 74 68 65 20 72 |ssion. |If the r|
|000030e0| 65 73 75 6c 74 20 6f 66 | 0a 65 76 61 6c 75 61 74 |esult of|.evaluat|
|000030f0| 69 6e 67 20 5c 68 79 70 | 65 72 7b 6b 65 79 7d 20 |ing \hyp|er{key} |
|00003100| 69 73 20 64 69 66 66 65 | 72 65 6e 74 20 66 72 6f |is diffe|rent fro|
|00003110| 6d 20 65 76 65 72 79 20 | 5c 68 79 70 65 72 7b 64 |m every |\hyper{d|
|00003120| 61 74 75 6d 7d 2c 20 74 | 68 65 6e 20 69 66 0a 74 |atum}, t|hen if.t|
|00003130| 68 65 72 65 20 69 73 20 | 61 6e 20 65 6c 73 65 20 |here is |an else |
|00003140| 63 6c 61 75 73 65 20 69 | 74 73 20 65 78 70 72 65 |clause i|ts expre|
|00003150| 73 73 69 6f 6e 73 20 61 | 72 65 20 65 76 61 6c 75 |ssions a|re evalu|
|00003160| 61 74 65 64 20 61 6e 64 | 20 74 68 65 0a 72 65 73 |ated and| the.res|
|00003170| 75 6c 74 20 6f 66 20 74 | 68 65 20 6c 61 73 74 20 |ult of t|he last |
|00003180| 69 73 20 74 68 65 20 72 | 65 73 75 6c 74 20 6f 66 |is the r|esult of|
|00003190| 20 74 68 65 20 5c 69 64 | 65 7b 63 61 73 65 7d 20 | the \id|e{case} |
|000031a0| 65 78 70 72 65 73 73 69 | 6f 6e 3b 20 6f 74 68 65 |expressi|on; othe|
|000031b0| 72 77 69 73 65 0a 74 68 | 65 20 72 65 73 75 6c 74 |rwise.th|e result|
|000031c0| 20 6f 66 20 74 68 65 20 | 5c 69 64 65 7b 63 61 73 | of the |\ide{cas|
|000031d0| 65 7d 20 65 78 70 72 65 | 73 73 69 6f 6e 20 69 73 |e} expre|ssion is|
|000031e0| 20 75 6e 73 70 65 63 69 | 66 69 65 64 2e 0a 0a 5c | unspeci|fied...\|
|000031f0| 62 65 67 69 6e 7b 73 63 | 68 65 6d 65 7d 0a 28 63 |begin{sc|heme}.(c|
|00003200| 61 73 65 20 28 2a 20 32 | 20 33 29 0a 20 20 28 28 |ase (* 2| 3). ((|
|00003210| 32 20 33 20 35 20 37 29 | 20 27 70 72 69 6d 65 29 |2 3 5 7)| 'prime)|
|00003220| 0a 20 20 28 28 31 20 34 | 20 36 20 38 20 39 29 20 |. ((1 4| 6 8 9) |
|00003230| 27 63 6f 6d 70 6f 73 69 | 74 65 29 29 20 20 20 20 |'composi|te)) |
|00003240| 20 5c 65 76 20 20 63 6f | 6d 70 6f 73 69 74 65 0a | \ev co|mposite.|
|00003250| 28 63 61 73 65 20 28 63 | 61 72 20 27 28 63 20 64 |(case (c|ar '(c d|
|00003260| 29 29 0a 20 20 28 28 61 | 29 20 27 61 29 0a 20 20 |)). ((a|) 'a). |
|00003270| 28 28 62 29 20 27 62 29 | 29 20 20 20 20 20 20 20 |((b) 'b)|) |
|00003280| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 5c 65 | | \e|
|00003290| 76 20 20 5c 75 6e 73 70 | 65 63 69 66 69 65 64 0a |v \unsp|ecified.|
|000032a0| 28 63 61 73 65 20 28 63 | 61 72 20 27 28 63 20 64 |(case (c|ar '(c d|
|000032b0| 29 29 0a 20 20 28 28 61 | 20 65 20 69 20 6f 20 75 |)). ((a| e i o u|
|000032c0| 29 20 27 76 6f 77 65 6c | 29 0a 20 20 28 28 77 20 |) 'vowel|). ((w |
|000032d0| 79 29 20 27 73 65 6d 69 | 76 6f 77 65 6c 29 0a 20 |y) 'semi|vowel). |
|000032e0| 20 28 65 6c 73 65 20 27 | 63 6f 6e 73 6f 6e 61 6e | (else '|consonan|
|000032f0| 74 29 29 20 20 20 20 20 | 20 20 20 20 20 20 20 5c |t)) | \|
|00003300| 65 76 20 20 63 6f 6e 73 | 6f 6e 61 6e 74 25 0a 5c |ev cons|onant%.\|
|00003310| 65 6e 64 7b 73 63 68 65 | 6d 65 7d 0a 0a 5c 65 6e |end{sche|me}..\en|
|00003320| 64 7b 65 6e 74 72 79 7d | 0a 0a 0a 5c 62 65 67 69 |d{entry}|...\begi|
|00003330| 6e 7b 65 6e 74 72 79 7d | 7b 25 0a 5c 70 72 6f 74 |n{entry}|{%.\prot|
|00003340| 6f 7b 61 6e 64 7d 7b 20 | 5c 68 79 70 65 72 69 7b |o{and}{ |\hyperi{|
|00003350| 74 65 73 74 7d 20 5c 64 | 6f 74 73 66 6f 6f 7d 7b |test} \d|otsfoo}{|
|00003360| 65 73 73 65 6e 74 69 61 | 6c 20 5c 65 78 70 72 74 |essentia|l \exprt|
|00003370| 79 70 65 7d 7d 0a 0a 54 | 68 65 20 5c 68 79 70 65 |ype}}..T|he \hype|
|00003380| 72 7b 74 65 73 74 7d 20 | 65 78 70 72 65 73 73 69 |r{test} |expressi|
|00003390| 6f 6e 73 20 61 72 65 20 | 65 76 61 6c 75 61 74 65 |ons are |evaluate|
|000033a0| 64 20 66 72 6f 6d 20 6c | 65 66 74 20 74 6f 20 72 |d from l|eft to r|
|000033b0| 69 67 68 74 2c 20 61 6e | 64 20 74 68 65 0a 76 61 |ight, an|d the.va|
|000033c0| 6c 75 65 20 6f 66 20 74 | 68 65 20 66 69 72 73 74 |lue of t|he first|
|000033d0| 20 65 78 70 72 65 73 73 | 69 6f 6e 20 74 68 61 74 | express|ion that|
|000033e0| 20 65 76 61 6c 75 61 74 | 65 73 20 74 6f 20 61 20 | evaluat|es to a |
|000033f0| 66 61 6c 73 65 20 76 61 | 6c 75 65 20 28 73 65 65 |false va|lue (see|
|00003400| 0a 73 65 63 74 69 6f 6e | 7e 5c 72 65 66 7b 62 6f |.section|~\ref{bo|
|00003410| 6f 6c 65 61 6e 73 65 63 | 74 69 6f 6e 7d 29 20 69 |oleansec|tion}) i|
|00003420| 73 20 72 65 74 75 72 6e | 65 64 2e 20 20 41 6e 79 |s return|ed. Any|
|00003430| 20 72 65 6d 61 69 6e 69 | 6e 67 20 65 78 70 72 65 | remaini|ng expre|
|00003440| 73 73 69 6f 6e 73 0a 61 | 72 65 20 6e 6f 74 20 65 |ssions.a|re not e|
|00003450| 76 61 6c 75 61 74 65 64 | 2e 20 20 49 66 20 61 6c |valuated|. If al|
|00003460| 6c 20 74 68 65 20 65 78 | 70 72 65 73 73 69 6f 6e |l the ex|pression|
|00003470| 73 20 65 76 61 6c 75 61 | 74 65 20 74 6f 20 74 72 |s evalua|te to tr|
|00003480| 75 65 20 76 61 6c 75 65 | 73 2c 20 74 68 65 0a 76 |ue value|s, the.v|
|00003490| 61 6c 75 65 20 6f 66 20 | 74 68 65 20 6c 61 73 74 |alue of |the last|
|000034a0| 20 65 78 70 72 65 73 73 | 69 6f 6e 20 69 73 20 72 | express|ion is r|
|000034b0| 65 74 75 72 6e 65 64 2e | 20 20 49 66 20 74 68 65 |eturned.| If the|
|000034c0| 72 65 20 61 72 65 20 6e | 6f 20 65 78 70 72 65 73 |re are n|o expres|
|000034d0| 73 69 6f 6e 73 0a 74 68 | 65 6e 20 5c 73 63 68 74 |sions.th|en \scht|
|000034e0| 72 75 65 7b 7d 20 69 73 | 20 72 65 74 75 72 6e 65 |rue{} is| returne|
|000034f0| 64 2e 0a 0a 5c 62 65 67 | 69 6e 7b 73 63 68 65 6d |d...\beg|in{schem|
|00003500| 65 7d 0a 28 61 6e 64 20 | 28 3d 20 32 20 32 29 20 |e}.(and |(= 2 2) |
|00003510| 28 3e 20 32 20 31 29 29 | 20 20 20 20 20 20 20 20 |(> 2 1))| |
|00003520| 20 20 20 5c 65 76 20 20 | 5c 73 63 68 74 72 75 65 | \ev |\schtrue|
|00003530| 0a 28 61 6e 64 20 28 3d | 20 32 20 32 29 20 28 3c |.(and (=| 2 2) (<|
|00003540| 20 32 20 31 29 29 20 20 | 20 20 20 20 20 20 20 20 | 2 1)) | |
|00003550| 20 5c 65 76 20 20 5c 73 | 63 68 66 61 6c 73 65 0a | \ev \s|chfalse.|
|00003560| 28 61 6e 64 20 31 20 32 | 20 27 63 20 27 28 66 20 |(and 1 2| 'c '(f |
|00003570| 67 29 29 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |g)) | |
|00003580| 5c 65 76 20 20 28 66 20 | 67 29 0a 28 61 6e 64 29 |\ev (f |g).(and)|
|00003590| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000035a0| 20 20 20 20 20 20 20 20 | 20 20 20 5c 65 76 20 20 | | \ev |
|000035b0| 5c 73 63 68 74 72 75 65 | 25 0a 5c 65 6e 64 7b 73 |\schtrue|%.\end{s|
|000035c0| 63 68 65 6d 65 7d 0a 0a | 5c 65 6e 64 7b 65 6e 74 |cheme}..|\end{ent|
|000035d0| 72 79 7d 0a 0a 0a 5c 62 | 65 67 69 6e 7b 65 6e 74 |ry}...\b|egin{ent|
|000035e0| 72 79 7d 7b 25 0a 5c 70 | 72 6f 74 6f 7b 6f 72 7d |ry}{%.\p|roto{or}|
|000035f0| 7b 20 5c 68 79 70 65 72 | 69 7b 74 65 73 74 7d 20 |{ \hyper|i{test} |
|00003600| 5c 64 6f 74 73 66 6f 6f | 7d 7b 65 73 73 65 6e 74 |\dotsfoo|}{essent|
|00003610| 69 61 6c 20 5c 65 78 70 | 72 74 79 70 65 7d 7d 0a |ial \exp|rtype}}.|
|00003620| 0a 54 68 65 20 5c 68 79 | 70 65 72 7b 74 65 73 74 |.The \hy|per{test|
|00003630| 7d 20 65 78 70 72 65 73 | 73 69 6f 6e 73 20 61 72 |} expres|sions ar|
|00003640| 65 20 65 76 61 6c 75 61 | 74 65 64 20 66 72 6f 6d |e evalua|ted from|
|00003650| 20 6c 65 66 74 20 74 6f | 20 72 69 67 68 74 2c 20 | left to| right, |
|00003660| 61 6e 64 20 74 68 65 20 | 76 61 6c 75 65 20 6f 66 |and the |value of|
|00003670| 20 74 68 65 0a 66 69 72 | 73 74 20 65 78 70 72 65 | the.fir|st expre|
|00003680| 73 73 69 6f 6e 20 74 68 | 61 74 20 65 76 61 6c 75 |ssion th|at evalu|
|00003690| 61 74 65 73 20 74 6f 20 | 61 20 74 72 75 65 20 76 |ates to |a true v|
|000036a0| 61 6c 75 65 20 28 73 65 | 65 0a 73 65 63 74 69 6f |alue (se|e.sectio|
|000036b0| 6e 7e 5c 72 65 66 7b 62 | 6f 6f 6c 65 61 6e 73 65 |n~\ref{b|ooleanse|
|000036c0| 63 74 69 6f 6e 7d 29 20 | 69 73 20 72 65 74 75 72 |ction}) |is retur|
|000036d0| 6e 65 64 2e 20 20 41 6e | 79 20 72 65 6d 61 69 6e |ned. An|y remain|
|000036e0| 69 6e 67 20 65 78 70 72 | 65 73 73 69 6f 6e 73 0a |ing expr|essions.|
|000036f0| 61 72 65 20 6e 6f 74 20 | 65 76 61 6c 75 61 74 65 |are not |evaluate|
|00003700| 64 2e 20 20 49 66 20 61 | 6c 6c 20 65 78 70 72 65 |d. If a|ll expre|
|00003710| 73 73 69 6f 6e 73 20 65 | 76 61 6c 75 61 74 65 20 |ssions e|valuate |
|00003720| 74 6f 20 66 61 6c 73 65 | 20 76 61 6c 75 65 73 2c |to false| values,|
|00003730| 20 74 68 65 0a 76 61 6c | 75 65 20 6f 66 20 74 68 | the.val|ue of th|
|00003740| 65 20 6c 61 73 74 20 65 | 78 70 72 65 73 73 69 6f |e last e|xpressio|
|00003750| 6e 20 69 73 20 72 65 74 | 75 72 6e 65 64 2e 20 20 |n is ret|urned. |
|00003760| 49 66 20 74 68 65 72 65 | 20 61 72 65 20 6e 6f 0a |If there| are no.|
|00003770| 65 78 70 72 65 73 73 69 | 6f 6e 73 20 74 68 65 6e |expressi|ons then|
|00003780| 20 5c 73 63 68 66 61 6c | 73 65 7b 7d 20 69 73 20 | \schfal|se{} is |
|00003790| 72 65 74 75 72 6e 65 64 | 2e 0a 0a 5c 62 65 67 69 |returned|...\begi|
|000037a0| 6e 7b 73 63 68 65 6d 65 | 7d 0a 28 6f 72 20 28 3d |n{scheme|}.(or (=|
|000037b0| 20 32 20 32 29 20 28 3e | 20 32 20 31 29 29 20 20 | 2 2) (>| 2 1)) |
|000037c0| 20 20 20 20 20 20 20 20 | 20 20 5c 65 76 20 20 5c | | \ev \|
|000037d0| 73 63 68 74 72 75 65 0a | 28 6f 72 20 28 3d 20 32 |schtrue.|(or (= 2|
|000037e0| 20 32 29 20 28 3c 20 32 | 20 31 29 29 20 20 20 20 | 2) (< 2| 1)) |
|000037f0| 20 20 20 20 20 20 20 20 | 5c 65 76 20 20 5c 73 63 | |\ev \sc|
|00003800| 68 74 72 75 65 0a 28 6f | 72 20 5c 73 63 68 66 61 |htrue.(o|r \schfa|
|00003810| 6c 73 65 20 5c 73 63 68 | 66 61 6c 73 65 20 5c 73 |lse \sch|false \s|
|00003820| 63 68 66 61 6c 73 65 29 | 20 5c 65 76 20 20 5c 73 |chfalse)| \ev \s|
|00003830| 63 68 66 61 6c 73 65 0a | 28 6f 72 20 28 6d 65 6d |chfalse.|(or (mem|
|00003840| 71 20 27 62 20 27 28 61 | 20 62 20 63 29 29 20 0a |q 'b '(a| b c)) .|
|00003850| 20 20 20 20 28 2f 20 33 | 20 30 29 29 20 20 20 20 | (/ 3| 0)) |
|00003860| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003870| 5c 65 76 20 20 28 62 20 | 63 29 25 0a 5c 65 6e 64 |\ev (b |c)%.\end|
|00003880| 7b 73 63 68 65 6d 65 7d | 0a 0a 5c 65 6e 64 7b 65 |{scheme}|..\end{e|
|00003890| 6e 74 72 79 7d 0a 0a 0a | 5c 73 75 62 73 65 63 74 |ntry}...|\subsect|
|000038a0| 69 6f 6e 7b 42 69 6e 64 | 69 6e 67 20 63 6f 6e 73 |ion{Bind|ing cons|
|000038b0| 74 72 75 63 74 73 7d 0a | 0a 54 68 65 20 74 68 72 |tructs}.|.The thr|
|000038c0| 65 65 20 62 69 6e 64 69 | 6e 67 20 63 6f 6e 73 74 |ee bindi|ng const|
|000038d0| 72 75 63 74 73 20 5c 69 | 64 65 7b 6c 65 74 7d 2c |ructs \i|de{let},|
|000038e0| 20 5c 69 64 65 7b 6c 65 | 74 2a 7d 2c 20 61 6e 64 | \ide{le|t*}, and|
|000038f0| 20 5c 69 64 65 7b 6c 65 | 74 72 65 63 7d 0a 67 69 | \ide{le|trec}.gi|
|00003900| 76 65 20 53 63 68 65 6d | 65 20 61 20 62 6c 6f 63 |ve Schem|e a bloc|
|00003910| 6b 20 73 74 72 75 63 74 | 75 72 65 2c 20 6c 69 6b |k struct|ure, lik|
|00003920| 65 20 41 6c 67 6f 6c 20 | 36 30 2e 20 20 54 68 65 |e Algol |60. The|
|00003930| 20 73 79 6e 74 61 78 20 | 6f 66 20 74 68 65 20 74 | syntax |of the t|
|00003940| 68 72 65 65 0a 63 6f 6e | 73 74 72 75 63 74 73 20 |hree.con|structs |
|00003950| 69 73 20 69 64 65 6e 74 | 69 63 61 6c 2c 20 62 75 |is ident|ical, bu|
|00003960| 74 20 74 68 65 79 20 64 | 69 66 66 65 72 20 69 6e |t they d|iffer in|
|00003970| 20 74 68 65 20 72 65 67 | 69 6f 6e 73 5c 69 6e 64 | the reg|ions\ind|
|00003980| 65 78 7b 72 65 67 69 6f | 6e 7d 20 74 68 65 79 20 |ex{regio|n} they |
|00003990| 65 73 74 61 62 6c 69 73 | 68 0a 66 6f 72 20 74 68 |establis|h.for th|
|000039a0| 65 69 72 20 76 61 72 69 | 61 62 6c 65 20 62 69 6e |eir vari|able bin|
|000039b0| 64 69 6e 67 73 2e 20 20 | 49 6e 20 61 20 5c 69 64 |dings. |In a \id|
|000039c0| 65 7b 6c 65 74 7d 20 65 | 78 70 72 65 73 73 69 6f |e{let} e|xpressio|
|000039d0| 6e 2c 20 74 68 65 20 69 | 6e 69 74 69 61 6c 0a 76 |n, the i|nitial.v|
|000039e0| 61 6c 75 65 73 20 61 72 | 65 20 63 6f 6d 70 75 74 |alues ar|e comput|
|000039f0| 65 64 20 62 65 66 6f 72 | 65 20 61 6e 79 20 6f 66 |ed befor|e any of|
|00003a00| 20 74 68 65 20 76 61 72 | 69 61 62 6c 65 73 20 62 | the var|iables b|
|00003a10| 65 63 6f 6d 65 20 62 6f | 75 6e 64 3b 20 69 6e 20 |ecome bo|und; in |
|00003a20| 61 0a 5c 69 64 65 7b 6c | 65 74 2a 7d 20 65 78 70 |a.\ide{l|et*} exp|
|00003a30| 72 65 73 73 69 6f 6e 2c | 20 74 68 65 20 62 69 6e |ression,| the bin|
|00003a40| 64 69 6e 67 73 20 61 6e | 64 20 65 76 61 6c 75 61 |dings an|d evalua|
|00003a50| 74 69 6f 6e 73 20 61 72 | 65 20 70 65 72 66 6f 72 |tions ar|e perfor|
|00003a60| 6d 65 64 0a 73 65 71 75 | 65 6e 74 69 61 6c 6c 79 |med.sequ|entially|
|00003a70| 3b 20 77 68 69 6c 65 20 | 69 6e 20 61 20 5c 69 64 |; while |in a \id|
|00003a80| 65 7b 6c 65 74 72 65 63 | 7d 20 65 78 70 72 65 73 |e{letrec|} expres|
|00003a90| 73 69 6f 6e 2c 20 61 6c | 6c 20 74 68 65 20 62 69 |sion, al|l the bi|
|00003aa0| 6e 64 69 6e 67 73 20 61 | 72 65 20 69 6e 0a 65 66 |ndings a|re in.ef|
|00003ab0| 66 65 63 74 20 77 68 69 | 6c 65 20 74 68 65 69 72 |fect whi|le their|
|00003ac0| 20 69 6e 69 74 69 61 6c | 20 76 61 6c 75 65 73 20 | initial| values |
|00003ad0| 61 72 65 20 62 65 69 6e | 67 20 63 6f 6d 70 75 74 |are bein|g comput|
|00003ae0| 65 64 2c 20 74 68 75 73 | 20 61 6c 6c 6f 77 69 6e |ed, thus| allowin|
|00003af0| 67 0a 6d 75 74 75 61 6c | 6c 79 20 72 65 63 75 72 |g.mutual|ly recur|
|00003b00| 73 69 76 65 20 64 65 66 | 69 6e 69 74 69 6f 6e 73 |sive def|initions|
|00003b10| 2e 0a 0a 5c 62 65 67 69 | 6e 7b 65 6e 74 72 79 7d |...\begi|n{entry}|
|00003b20| 7b 25 0a 5c 70 72 6f 74 | 6f 7b 6c 65 74 7d 7b 20 |{%.\prot|o{let}{ |
|00003b30| 5c 68 79 70 65 72 7b 62 | 69 6e 64 69 6e 67 73 7d |\hyper{b|indings}|
|00003b40| 20 5c 68 79 70 65 72 7b | 62 6f 64 79 7d 7d 7b 65 | \hyper{|body}}{e|
|00003b50| 73 73 65 6e 74 69 61 6c | 20 5c 65 78 70 72 74 79 |ssential| \exprty|
|00003b60| 70 65 7d 7d 0a 0a 5c 73 | 79 6e 74 61 78 0a 5c 68 |pe}}..\s|yntax.\h|
|00003b70| 79 70 65 72 7b 42 69 6e | 64 69 6e 67 73 7d 20 73 |yper{Bin|dings} s|
|00003b80| 68 6f 75 6c 64 20 68 61 | 76 65 20 74 68 65 20 66 |hould ha|ve the f|
|00003b90| 6f 72 6d 0a 5c 62 65 67 | 69 6e 7b 73 63 68 65 6d |orm.\beg|in{schem|
|00003ba0| 65 7d 0a 28 28 5c 68 79 | 70 65 72 69 7b 76 61 72 |e}.((\hy|peri{var|
|00003bb0| 69 61 62 6c 65 7d 20 5c | 68 79 70 65 72 69 7b 69 |iable} \|hyperi{i|
|00003bc0| 6e 69 74 7d 29 20 5c 64 | 6f 74 73 66 6f 6f 29 5c |nit}) \d|otsfoo)\|
|00003bd0| 72 6d 2c 25 0a 5c 65 6e | 64 7b 73 63 68 65 6d 65 |rm,%.\en|d{scheme|
|00003be0| 7d 0a 77 68 65 72 65 20 | 65 61 63 68 20 5c 68 79 |}.where |each \hy|
|00003bf0| 70 65 72 7b 69 6e 69 74 | 7d 20 69 73 20 61 6e 20 |per{init|} is an |
|00003c00| 65 78 70 72 65 73 73 69 | 6f 6e 2c 20 61 6e 64 20 |expressi|on, and |
|00003c10| 5c 68 79 70 65 72 7b 62 | 6f 64 79 7d 20 73 68 6f |\hyper{b|ody} sho|
|00003c20| 75 6c 64 20 62 65 20 61 | 0a 73 65 71 75 65 6e 63 |uld be a|.sequenc|
|00003c30| 65 20 6f 66 20 6f 6e 65 | 20 6f 72 20 6d 6f 72 65 |e of one| or more|
|00003c40| 20 65 78 70 72 65 73 73 | 69 6f 6e 73 2e 20 20 49 | express|ions. I|
|00003c50| 74 20 69 73 0a 61 6e 20 | 65 72 72 6f 72 20 66 6f |t is.an |error fo|
|00003c60| 72 20 61 20 5c 68 79 70 | 65 72 7b 76 61 72 69 61 |r a \hyp|er{varia|
|00003c70| 62 6c 65 7d 20 74 6f 20 | 61 70 70 65 61 72 20 6d |ble} to |appear m|
|00003c80| 6f 72 65 20 74 68 61 6e | 20 6f 6e 63 65 20 69 6e |ore than| once in|
|00003c90| 20 74 68 65 20 6c 69 73 | 74 20 6f 66 20 76 61 72 | the lis|t of var|
|00003ca0| 69 61 62 6c 65 73 0a 62 | 65 69 6e 67 20 62 6f 75 |iables.b|eing bou|
|00003cb0| 6e 64 2e 0a 0a 5c 73 65 | 6d 61 6e 74 69 63 73 0a |nd...\se|mantics.|
|00003cc0| 54 68 65 20 5c 68 79 70 | 65 72 7b 69 6e 69 74 7d |The \hyp|er{init}|
|00003cd0| 73 20 61 72 65 20 65 76 | 61 6c 75 61 74 65 64 20 |s are ev|aluated |
|00003ce0| 69 6e 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 65 |in the c|urrent e|
|00003cf0| 6e 76 69 72 6f 6e 6d 65 | 6e 74 20 28 69 6e 20 73 |nvironme|nt (in s|
|00003d00| 6f 6d 65 0a 75 6e 73 70 | 65 63 69 66 69 65 64 20 |ome.unsp|ecified |
|00003d10| 6f 72 64 65 72 29 2c 20 | 74 68 65 20 5c 68 79 70 |order), |the \hyp|
|00003d20| 65 72 7b 76 61 72 69 61 | 62 6c 65 7d 73 20 61 72 |er{varia|ble}s ar|
|00003d30| 65 20 62 6f 75 6e 64 20 | 74 6f 20 66 72 65 73 68 |e bound |to fresh|
|00003d40| 20 6c 6f 63 61 74 69 6f | 6e 73 0a 68 6f 6c 64 69 | locatio|ns.holdi|
|00003d50| 6e 67 20 74 68 65 20 72 | 65 73 75 6c 74 73 2c 20 |ng the r|esults, |
|00003d60| 74 68 65 20 5c 68 79 70 | 65 72 7b 62 6f 64 79 7d |the \hyp|er{body}|
|00003d70| 20 69 73 20 65 76 61 6c | 75 61 74 65 64 20 69 6e | is eval|uated in|
|00003d80| 20 74 68 65 20 65 78 74 | 65 6e 64 65 64 0a 65 6e | the ext|ended.en|
|00003d90| 76 69 72 6f 6e 6d 65 6e | 74 2c 20 61 6e 64 20 74 |vironmen|t, and t|
|00003da0| 68 65 20 76 61 6c 75 65 | 20 6f 66 20 74 68 65 20 |he value| of the |
|00003db0| 6c 61 73 74 20 65 78 70 | 72 65 73 73 69 6f 6e 20 |last exp|ression |
|00003dc0| 6f 66 20 5c 68 79 70 65 | 72 7b 62 6f 64 79 7d 20 |of \hype|r{body} |
|00003dd0| 69 73 0a 72 65 74 75 72 | 6e 65 64 2e 20 20 45 61 |is.retur|ned. Ea|
|00003de0| 63 68 20 62 69 6e 64 69 | 6e 67 20 6f 66 20 61 20 |ch bindi|ng of a |
|00003df0| 5c 68 79 70 65 72 7b 76 | 61 72 69 61 62 6c 65 7d |\hyper{v|ariable}|
|00003e00| 20 68 61 73 20 5c 68 79 | 70 65 72 7b 62 6f 64 79 | has \hy|per{body|
|00003e10| 7d 20 61 73 20 69 74 73 | 0a 72 65 67 69 6f 6e 2e |} as its|.region.|
|00003e20| 5c 69 6e 64 65 78 7b 72 | 65 67 69 6f 6e 7d 0a 0a |\index{r|egion}..|
|00003e30| 5c 62 65 67 69 6e 7b 73 | 63 68 65 6d 65 7d 0a 28 |\begin{s|cheme}.(|
|00003e40| 6c 65 74 20 28 28 78 20 | 32 29 20 28 79 20 33 29 |let ((x |2) (y 3)|
|00003e50| 29 0a 20 20 28 2a 20 78 | 20 79 29 29 20 20 20 20 |). (* x| y)) |
|00003e60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003e70| 20 20 5c 65 76 20 20 36 | 0a 0a 28 6c 65 74 20 28 | \ev 6|..(let (|
|00003e80| 28 78 20 32 29 20 28 79 | 20 33 29 29 0a 20 20 28 |(x 2) (y| 3)). (|
|00003e90| 6c 65 74 20 28 28 78 20 | 37 29 0a 20 20 20 20 20 |let ((x |7). |
|00003ea0| 20 20 20 28 7a 20 28 2b | 20 78 20 79 29 29 29 0a | (z (+| x y))).|
|00003eb0| 20 20 20 20 28 2a 20 7a | 20 78 29 29 29 20 20 20 | (* z| x))) |
|00003ec0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003ed0| 5c 65 76 20 20 33 35 25 | 0a 5c 65 6e 64 7b 73 63 |\ev 35%|.\end{sc|
|00003ee0| 68 65 6d 65 7d 0a 0a 53 | 65 65 20 61 6c 73 6f 20 |heme}..S|ee also |
|00003ef0| 6e 61 6d 65 64 20 5c 69 | 64 65 7b 6c 65 74 7d 2c |named \i|de{let},|
|00003f00| 20 73 65 63 74 69 6f 6e | 20 5c 72 65 66 7b 6e 61 | section| \ref{na|
|00003f10| 6d 65 64 6c 65 74 7d 2e | 0a 0a 5c 65 6e 64 7b 65 |medlet}.|..\end{e|
|00003f20| 6e 74 72 79 7d 0a 0a 0a | 5c 62 65 67 69 6e 7b 65 |ntry}...|\begin{e|
|00003f30| 6e 74 72 79 7d 7b 25 0a | 5c 70 72 6f 74 6f 7b 6c |ntry}{%.|\proto{l|
|00003f40| 65 74 2a 7d 7b 20 5c 68 | 79 70 65 72 7b 62 69 6e |et*}{ \h|yper{bin|
|00003f50| 64 69 6e 67 73 7d 20 5c | 68 79 70 65 72 7b 62 6f |dings} \|hyper{bo|
|00003f60| 64 79 7d 7d 7b 5c 65 78 | 70 72 74 79 70 65 7d 7d |dy}}{\ex|prtype}}|
|00003f70| 5c 6e 6f 62 72 65 61 6b | 0a 0a 5c 6e 6f 62 72 65 |\nobreak|..\nobre|
|00003f80| 61 6b 0a 5c 73 79 6e 74 | 61 78 0a 5c 68 79 70 65 |ak.\synt|ax.\hype|
|00003f90| 72 7b 42 69 6e 64 69 6e | 67 73 7d 20 73 68 6f 75 |r{Bindin|gs} shou|
|00003fa0| 6c 64 20 68 61 76 65 20 | 74 68 65 20 66 6f 72 6d |ld have |the form|
|00003fb0| 0a 5c 62 65 67 69 6e 7b | 73 63 68 65 6d 65 7d 0a |.\begin{|scheme}.|
|00003fc0| 28 28 5c 68 79 70 65 72 | 69 7b 76 61 72 69 61 62 |((\hyper|i{variab|
|00003fd0| 6c 65 7d 20 5c 68 79 70 | 65 72 69 7b 69 6e 69 74 |le} \hyp|eri{init|
|00003fe0| 7d 29 20 5c 64 6f 74 73 | 66 6f 6f 29 5c 72 6d 2c |}) \dots|foo)\rm,|
|00003ff0| 25 0a 5c 65 6e 64 7b 73 | 63 68 65 6d 65 7d 0a 61 |%.\end{s|cheme}.a|
|00004000| 6e 64 20 5c 68 79 70 65 | 72 7b 62 6f 64 79 7d 20 |nd \hype|r{body} |
|00004010| 73 68 6f 75 6c 64 20 62 | 65 20 61 20 73 65 71 75 |should b|e a sequ|
|00004020| 65 6e 63 65 20 6f 66 0a | 6f 6e 65 20 6f 72 20 6d |ence of.|one or m|
|00004030| 6f 72 65 20 65 78 70 72 | 65 73 73 69 6f 6e 73 2e |ore expr|essions.|
|00004040| 0a 0a 5c 73 65 6d 61 6e | 74 69 63 73 0a 5c 69 64 |..\seman|tics.\id|
|00004050| 65 7b 4c 65 74 2a 7d 20 | 69 73 20 73 69 6d 69 6c |e{Let*} |is simil|
|00004060| 61 72 20 74 6f 20 5c 69 | 64 65 7b 6c 65 74 7d 2c |ar to \i|de{let},|
|00004070| 20 62 75 74 20 74 68 65 | 20 62 69 6e 64 69 6e 67 | but the| binding|
|00004080| 73 20 61 72 65 20 70 65 | 72 66 6f 72 6d 65 64 0a |s are pe|rformed.|
|00004090| 73 65 71 75 65 6e 74 69 | 61 6c 6c 79 20 66 72 6f |sequenti|ally fro|
|000040a0| 6d 20 6c 65 66 74 20 74 | 6f 20 72 69 67 68 74 2c |m left t|o right,|
|000040b0| 20 61 6e 64 20 74 68 65 | 20 72 65 67 69 6f 6e 5c | and the| region\|
|000040c0| 69 6e 64 65 78 7b 72 65 | 67 69 6f 6e 7d 20 6f 66 |index{re|gion} of|
|000040d0| 20 61 20 62 69 6e 64 69 | 6e 67 20 69 6e 64 69 63 | a bindi|ng indic|
|000040e0| 61 74 65 64 0a 62 79 20 | 7b 5c 63 66 28 5c 68 79 |ated.by |{\cf(\hy|
|000040f0| 70 65 72 7b 76 61 72 69 | 61 62 6c 65 7d 20 5c 68 |per{vari|able} \h|
|00004100| 79 70 65 72 7b 69 6e 69 | 74 7d 29 7d 20 69 73 20 |yper{ini|t})} is |
|00004110| 74 68 61 74 20 70 61 72 | 74 20 6f 66 20 74 68 65 |that par|t of the|
|00004120| 20 5c 69 64 65 7b 6c 65 | 74 2a 7d 0a 65 78 70 72 | \ide{le|t*}.expr|
|00004130| 65 73 73 69 6f 6e 20 74 | 6f 20 74 68 65 20 72 69 |ession t|o the ri|
|00004140| 67 68 74 20 6f 66 20 74 | 68 65 20 62 69 6e 64 69 |ght of t|he bindi|
|00004150| 6e 67 2e 20 20 54 68 75 | 73 20 74 68 65 20 73 65 |ng. Thu|s the se|
|00004160| 63 6f 6e 64 20 62 69 6e | 64 69 6e 67 20 69 73 20 |cond bin|ding is |
|00004170| 64 6f 6e 65 0a 69 6e 20 | 61 6e 20 65 6e 76 69 72 |done.in |an envir|
|00004180| 6f 6e 6d 65 6e 74 20 69 | 6e 20 77 68 69 63 68 20 |onment i|n which |
|00004190| 74 68 65 20 66 69 72 73 | 74 20 62 69 6e 64 69 6e |the firs|t bindin|
|000041a0| 67 20 69 73 20 76 69 73 | 69 62 6c 65 2c 20 61 6e |g is vis|ible, an|
|000041b0| 64 20 73 6f 20 6f 6e 2e | 0a 0a 5c 62 65 67 69 6e |d so on.|..\begin|
|000041c0| 7b 73 63 68 65 6d 65 7d | 0a 28 6c 65 74 20 28 28 |{scheme}|.(let ((|
|000041d0| 78 20 32 29 20 28 79 20 | 33 29 29 0a 20 20 28 6c |x 2) (y |3)). (l|
|000041e0| 65 74 2a 20 28 28 78 20 | 37 29 0a 20 20 20 20 20 |et* ((x |7). |
|000041f0| 20 20 20 20 28 7a 20 28 | 2b 20 78 20 79 29 29 29 | (z (|+ x y)))|
|00004200| 0a 20 20 20 20 28 2a 20 | 7a 20 78 29 29 29 20 20 |. (* |z x))) |
|00004210| 20 20 20 20 20 20 20 20 | 20 20 20 5c 65 76 20 20 | | \ev |
|00004220| 37 30 25 0a 5c 65 6e 64 | 7b 73 63 68 65 6d 65 7d |70%.\end|{scheme}|
|00004230| 0a 0a 5c 65 6e 64 7b 65 | 6e 74 72 79 7d 0a 0a 0a |..\end{e|ntry}...|
|00004240| 5c 62 65 67 69 6e 7b 65 | 6e 74 72 79 7d 7b 25 0a |\begin{e|ntry}{%.|
|00004250| 5c 70 72 6f 74 6f 7b 6c | 65 74 72 65 63 7d 7b 20 |\proto{l|etrec}{ |
|00004260| 5c 68 79 70 65 72 7b 62 | 69 6e 64 69 6e 67 73 7d |\hyper{b|indings}|
|00004270| 20 5c 68 79 70 65 72 7b | 62 6f 64 79 7d 7d 7b 65 | \hyper{|body}}{e|
|00004280| 73 73 65 6e 74 69 61 6c | 20 5c 65 78 70 72 74 79 |ssential| \exprty|
|00004290| 70 65 7d 7d 0a 0a 5c 73 | 79 6e 74 61 78 0a 5c 68 |pe}}..\s|yntax.\h|
|000042a0| 79 70 65 72 7b 42 69 6e | 64 69 6e 67 73 7d 20 73 |yper{Bin|dings} s|
|000042b0| 68 6f 75 6c 64 20 68 61 | 76 65 20 74 68 65 20 66 |hould ha|ve the f|
|000042c0| 6f 72 6d 0a 5c 62 65 67 | 69 6e 7b 73 63 68 65 6d |orm.\beg|in{schem|
|000042d0| 65 7d 0a 28 28 5c 68 79 | 70 65 72 69 7b 76 61 72 |e}.((\hy|peri{var|
|000042e0| 69 61 62 6c 65 7d 20 5c | 68 79 70 65 72 69 7b 69 |iable} \|hyperi{i|
|000042f0| 6e 69 74 7d 29 20 5c 64 | 6f 74 73 66 6f 6f 29 5c |nit}) \d|otsfoo)\|
|00004300| 72 6d 2c 25 0a 5c 65 6e | 64 7b 73 63 68 65 6d 65 |rm,%.\en|d{scheme|
|00004310| 7d 0a 61 6e 64 20 5c 68 | 79 70 65 72 7b 62 6f 64 |}.and \h|yper{bod|
|00004320| 79 7d 20 73 68 6f 75 6c | 64 20 62 65 20 61 20 73 |y} shoul|d be a s|
|00004330| 65 71 75 65 6e 63 65 20 | 6f 66 0a 6f 6e 65 20 6f |equence |of.one o|
|00004340| 72 20 6d 6f 72 65 20 65 | 78 70 72 65 73 73 69 6f |r more e|xpressio|
|00004350| 6e 73 2e 20 49 74 20 69 | 73 20 61 6e 20 65 72 72 |ns. It i|s an err|
|00004360| 6f 72 20 66 6f 72 20 61 | 20 5c 68 79 70 65 72 7b |or for a| \hyper{|
|00004370| 76 61 72 69 61 62 6c 65 | 7d 20 74 6f 20 61 70 70 |variable|} to app|
|00004380| 65 61 72 20 6d 6f 72 65 | 0a 74 68 61 6e 20 6f 6e |ear more|.than on|
|00004390| 63 65 20 69 6e 20 74 68 | 65 20 6c 69 73 74 20 6f |ce in th|e list o|
|000043a0| 66 20 76 61 72 69 61 62 | 6c 65 73 20 62 65 69 6e |f variab|les bein|
|000043b0| 67 20 62 6f 75 6e 64 2e | 0a 0a 5c 73 65 6d 61 6e |g bound.|..\seman|
|000043c0| 74 69 63 73 0a 54 68 65 | 20 5c 68 79 70 65 72 7b |tics.The| \hyper{|
|000043d0| 76 61 72 69 61 62 6c 65 | 7d 73 20 61 72 65 20 62 |variable|}s are b|
|000043e0| 6f 75 6e 64 20 74 6f 20 | 66 72 65 73 68 20 6c 6f |ound to |fresh lo|
|000043f0| 63 61 74 69 6f 6e 73 20 | 68 6f 6c 64 69 6e 67 20 |cations |holding |
|00004400| 75 6e 64 65 66 69 6e 65 | 64 0a 76 61 6c 75 65 73 |undefine|d.values|
|00004410| 2c 20 74 68 65 20 5c 68 | 79 70 65 72 7b 69 6e 69 |, the \h|yper{ini|
|00004420| 74 7d 73 20 61 72 65 20 | 65 76 61 6c 75 61 74 65 |t}s are |evaluate|
|00004430| 64 20 69 6e 20 74 68 65 | 20 72 65 73 75 6c 74 69 |d in the| resulti|
|00004440| 6e 67 20 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 20 28 |ng envir|onment (|
|00004450| 69 6e 0a 73 6f 6d 65 20 | 75 6e 73 70 65 63 69 66 |in.some |unspecif|
|00004460| 69 65 64 20 6f 72 64 65 | 72 29 2c 20 65 61 63 68 |ied orde|r), each|
|00004470| 20 5c 68 79 70 65 72 7b | 76 61 72 69 61 62 6c 65 | \hyper{|variable|
|00004480| 7d 20 69 73 20 61 73 73 | 69 67 6e 65 64 20 74 6f |} is ass|igned to|
|00004490| 20 74 68 65 20 72 65 73 | 75 6c 74 0a 6f 66 20 74 | the res|ult.of t|
|000044a0| 68 65 20 63 6f 72 72 65 | 73 70 6f 6e 64 69 6e 67 |he corre|sponding|
|000044b0| 20 5c 68 79 70 65 72 7b | 69 6e 69 74 7d 2c 20 74 | \hyper{|init}, t|
|000044c0| 68 65 20 5c 68 79 70 65 | 72 7b 62 6f 64 79 7d 20 |he \hype|r{body} |
|000044d0| 69 73 20 65 76 61 6c 75 | 61 74 65 64 20 69 6e 20 |is evalu|ated in |
|000044e0| 74 68 65 0a 72 65 73 75 | 6c 74 69 6e 67 20 65 6e |the.resu|lting en|
|000044f0| 76 69 72 6f 6e 6d 65 6e | 74 2c 20 61 6e 64 20 74 |vironmen|t, and t|
|00004500| 68 65 20 76 61 6c 75 65 | 20 6f 66 20 74 68 65 20 |he value| of the |
|00004510| 6c 61 73 74 20 65 78 70 | 72 65 73 73 69 6f 6e 20 |last exp|ression |
|00004520| 69 6e 0a 5c 68 79 70 65 | 72 7b 62 6f 64 79 7d 20 |in.\hype|r{body} |
|00004530| 69 73 20 72 65 74 75 72 | 6e 65 64 2e 20 20 45 61 |is retur|ned. Ea|
|00004540| 63 68 20 62 69 6e 64 69 | 6e 67 20 6f 66 20 61 20 |ch bindi|ng of a |
|00004550| 5c 68 79 70 65 72 7b 76 | 61 72 69 61 62 6c 65 7d |\hyper{v|ariable}|
|00004560| 20 68 61 73 20 74 68 65 | 0a 65 6e 74 69 72 65 20 | has the|.entire |
|00004570| 5c 69 64 65 7b 6c 65 74 | 72 65 63 7d 20 65 78 70 |\ide{let|rec} exp|
|00004580| 72 65 73 73 69 6f 6e 20 | 61 73 20 69 74 73 20 72 |ression |as its r|
|00004590| 65 67 69 6f 6e 5c 69 6e | 64 65 78 7b 72 65 67 69 |egion\in|dex{regi|
|000045a0| 6f 6e 7d 2c 20 6d 61 6b | 69 6e 67 20 69 74 20 70 |on}, mak|ing it p|
|000045b0| 6f 73 73 69 62 6c 65 20 | 74 6f 0a 64 65 66 69 6e |ossible |to.defin|
|000045c0| 65 20 6d 75 74 75 61 6c | 6c 79 20 72 65 63 75 72 |e mutual|ly recur|
|000045d0| 73 69 76 65 20 70 72 6f | 63 65 64 75 72 65 73 2e |sive pro|cedures.|
|000045e0| 0a 0a 5c 62 65 67 69 6e | 7b 73 63 68 65 6d 65 7d |..\begin|{scheme}|
|000045f0| 0a 25 28 6c 65 74 72 65 | 63 20 28 28 78 20 32 29 |.%(letre|c ((x 2)|
|00004600| 20 28 79 20 33 29 29 0a | 25 20 20 28 6c 65 74 72 | (y 3)).|% (letr|
|00004610| 65 63 20 28 28 66 6f 6f | 20 28 6c 61 6d 62 64 61 |ec ((foo| (lambda|
|00004620| 20 28 7a 29 20 28 2b 20 | 78 20 79 20 7a 29 29 29 | (z) (+ |x y z)))|
|00004630| 20 28 78 20 37 29 29 0a | 25 20 20 20 20 28 66 6f | (x 7)).|% (fo|
|00004640| 6f 20 34 29 29 29 20 20 | 20 20 20 20 20 20 20 20 |o 4))) | |
|00004650| 20 20 20 20 20 20 20 20 | 20 5c 65 76 20 20 31 34 | | \ev 14|
|00004660| 0a 25 0a 28 6c 65 74 72 | 65 63 20 28 28 65 76 65 |.%.(letr|ec ((eve|
|00004670| 6e 3f 0a 20 20 20 20 20 | 20 20 20 20 20 28 6c 61 |n?. | (la|
|00004680| 6d 62 64 61 20 28 6e 29 | 0a 20 20 20 20 20 20 20 |mbda (n)|. |
|00004690| 20 20 20 20 20 28 69 66 | 20 28 7a 65 72 6f 3f 20 | (if| (zero? |
|000046a0| 6e 29 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |n). | |
|000046b0| 20 20 20 5c 73 63 68 74 | 72 75 65 0a 20 20 20 20 | \scht|rue. |
|000046c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 28 6f 64 64 | | (odd|
|000046d0| 3f 20 28 2d 20 6e 20 31 | 29 29 29 29 29 0a 20 20 |? (- n 1|))))). |
|000046e0| 20 20 20 20 20 20 20 28 | 6f 64 64 3f 0a 20 20 20 | (|odd?. |
|000046f0| 20 20 20 20 20 20 20 28 | 6c 61 6d 62 64 61 20 28 | (|lambda (|
|00004700| 6e 29 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 28 |n). | (|
|00004710| 69 66 20 28 7a 65 72 6f | 3f 20 6e 29 0a 20 20 20 |if (zero|? n). |
|00004720| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 5c 73 63 | | \sc|
|00004730| 68 66 61 6c 73 65 0a 20 | 20 20 20 20 20 20 20 20 |hfalse. | |
|00004740| 20 20 20 20 20 20 20 28 | 65 76 65 6e 3f 20 28 2d | (|even? (-|
|00004750| 20 6e 20 31 29 29 29 29 | 29 29 0a 20 20 28 65 76 | n 1))))|)). (ev|
|00004760| 65 6e 3f 20 38 38 29 29 | 20 20 20 0a 09 09 5c 65 |en? 88))| ...\e|
|00004770| 76 20 20 5c 73 63 68 74 | 72 75 65 25 0a 5c 65 6e |v \scht|rue%.\en|
|00004780| 64 7b 73 63 68 65 6d 65 | 7d 0a 0a 4f 6e 65 20 72 |d{scheme|}..One r|
|00004790| 65 73 74 72 69 63 74 69 | 6f 6e 20 6f 6e 20 5c 69 |estricti|on on \i|
|000047a0| 64 65 7b 6c 65 74 72 65 | 63 7d 20 69 73 20 76 65 |de{letre|c} is ve|
|000047b0| 72 79 20 69 6d 70 6f 72 | 74 61 6e 74 3a 20 69 74 |ry impor|tant: it|
|000047c0| 20 6d 75 73 74 20 62 65 | 20 70 6f 73 73 69 62 6c | must be| possibl|
|000047d0| 65 0a 74 6f 20 65 76 61 | 6c 75 61 74 65 20 65 61 |e.to eva|luate ea|
|000047e0| 63 68 20 5c 68 79 70 65 | 72 7b 69 6e 69 74 7d 20 |ch \hype|r{init} |
|000047f0| 77 69 74 68 6f 75 74 20 | 61 73 73 69 67 6e 69 6e |without |assignin|
|00004800| 67 20 6f 72 20 72 65 66 | 65 72 72 69 6e 67 20 74 |g or ref|erring t|
|00004810| 6f 20 74 68 65 20 76 61 | 6c 75 65 20 6f 66 20 61 |o the va|lue of a|
|00004820| 6e 79 0a 5c 68 79 70 65 | 72 7b 76 61 72 69 61 62 |ny.\hype|r{variab|
|00004830| 6c 65 7d 2e 20 20 49 66 | 20 74 68 69 73 20 72 65 |le}. If| this re|
|00004840| 73 74 72 69 63 74 69 6f | 6e 20 69 73 20 76 69 6f |strictio|n is vio|
|00004850| 6c 61 74 65 64 2c 20 74 | 68 65 6e 20 69 74 20 69 |lated, t|hen it i|
|00004860| 73 20 61 6e 20 65 72 72 | 6f 72 2e 20 20 54 68 65 |s an err|or. The|
|00004870| 0a 72 65 73 74 72 69 63 | 74 69 6f 6e 20 69 73 20 |.restric|tion is |
|00004880| 6e 65 63 65 73 73 61 72 | 79 20 62 65 63 61 75 73 |necessar|y becaus|
|00004890| 65 20 53 63 68 65 6d 65 | 20 70 61 73 73 65 73 20 |e Scheme| passes |
|000048a0| 61 72 67 75 6d 65 6e 74 | 73 20 62 79 20 76 61 6c |argument|s by val|
|000048b0| 75 65 20 72 61 74 68 65 | 72 20 74 68 61 6e 20 62 |ue rathe|r than b|
|000048c0| 79 0a 6e 61 6d 65 2e 20 | 20 49 6e 20 74 68 65 20 |y.name. | In the |
|000048d0| 6d 6f 73 74 20 63 6f 6d | 6d 6f 6e 20 75 73 65 73 |most com|mon uses|
|000048e0| 20 6f 66 20 5c 69 64 65 | 7b 6c 65 74 72 65 63 7d | of \ide|{letrec}|
|000048f0| 2c 20 61 6c 6c 20 74 68 | 65 20 5c 68 79 70 65 72 |, all th|e \hyper|
|00004900| 7b 69 6e 69 74 7d 73 20 | 61 72 65 0a 5c 6c 61 6d |{init}s |are.\lam|
|00004910| 62 64 61 65 78 70 7b 7d | 73 20 61 6e 64 20 74 68 |bdaexp{}|s and th|
|00004920| 65 20 72 65 73 74 72 69 | 63 74 69 6f 6e 20 69 73 |e restri|ction is|
|00004930| 20 73 61 74 69 73 66 69 | 65 64 20 61 75 74 6f 6d | satisfi|ed autom|
|00004940| 61 74 69 63 61 6c 6c 79 | 2e 0a 0a 25 20 5c 74 6f |atically|...% \to|
|00004950| 64 6f 7b 75 73 65 20 6f | 72 20 75 73 65 73 3f 20 |do{use o|r uses? |
|00004960| 20 2d 2d 2d 20 4a 69 6e | 78 2e 7d 0a 0a 5c 65 6e | --- Jin|x.}..\en|
|00004970| 64 7b 65 6e 74 72 79 7d | 0a 0a 0a 5c 73 75 62 73 |d{entry}|...\subs|
|00004980| 65 63 74 69 6f 6e 7b 53 | 65 71 75 65 6e 63 69 6e |ection{S|equencin|
|00004990| 67 7d 5c 75 6e 73 65 63 | 74 69 6f 6e 0a 0a 5c 62 |g}\unsec|tion..\b|
|000049a0| 65 67 69 6e 7b 65 6e 74 | 72 79 7d 7b 25 0a 5c 70 |egin{ent|ry}{%.\p|
|000049b0| 72 6f 74 6f 7b 62 65 67 | 69 6e 7d 7b 20 5c 68 79 |roto{beg|in}{ \hy|
|000049c0| 70 65 72 69 7b 65 78 70 | 72 65 73 73 69 6f 6e 7d |peri{exp|ression}|
|000049d0| 20 5c 68 79 70 65 72 69 | 69 7b 65 78 70 72 65 73 | \hyperi|i{expres|
|000049e0| 73 69 6f 6e 7d 20 5c 64 | 6f 74 73 66 6f 6f 7d 7b |sion} \d|otsfoo}{|
|000049f0| 65 73 73 65 6e 74 69 61 | 6c 20 5c 65 78 70 72 74 |essentia|l \exprt|
|00004a00| 79 70 65 7d 7d 0a 0a 54 | 68 65 20 5c 68 79 70 65 |ype}}..T|he \hype|
|00004a10| 72 7b 65 78 70 72 65 73 | 73 69 6f 6e 7d 73 20 61 |r{expres|sion}s a|
|00004a20| 72 65 20 65 76 61 6c 75 | 61 74 65 64 20 73 65 71 |re evalu|ated seq|
|00004a30| 75 65 6e 74 69 61 6c 6c | 79 20 66 72 6f 6d 20 6c |uentiall|y from l|
|00004a40| 65 66 74 20 74 6f 20 72 | 69 67 68 74 2c 0a 61 6e |eft to r|ight,.an|
|00004a50| 64 20 74 68 65 20 76 61 | 6c 75 65 20 6f 66 20 74 |d the va|lue of t|
|00004a60| 68 65 20 6c 61 73 74 20 | 5c 68 79 70 65 72 7b 65 |he last |\hyper{e|
|00004a70| 78 70 72 65 73 73 69 6f | 6e 7d 20 69 73 20 72 65 |xpressio|n} is re|
|00004a80| 74 75 72 6e 65 64 2e 20 | 20 54 68 69 73 0a 65 78 |turned. | This.ex|
|00004a90| 70 72 65 73 73 69 6f 6e | 20 74 79 70 65 20 69 73 |pression| type is|
|00004aa0| 20 75 73 65 64 20 74 6f | 20 73 65 71 75 65 6e 63 | used to| sequenc|
|00004ab0| 65 20 73 69 64 65 20 65 | 66 66 65 63 74 73 20 73 |e side e|ffects s|
|00004ac0| 75 63 68 20 61 73 20 69 | 6e 70 75 74 20 61 6e 64 |uch as i|nput and|
|00004ad0| 0a 6f 75 74 70 75 74 2e | 0a 0a 5c 62 65 67 69 6e |.output.|..\begin|
|00004ae0| 7b 73 63 68 65 6d 65 7d | 0a 28 64 65 66 69 6e 65 |{scheme}|.(define|
|00004af0| 20 78 20 30 29 0a 0a 28 | 62 65 67 69 6e 20 28 73 | x 0)..(|begin (s|
|00004b00| 65 74 21 20 78 20 35 29 | 0a 20 20 20 20 20 20 20 |et! x 5)|. |
|00004b10| 28 2b 20 78 20 31 29 29 | 20 20 20 20 20 20 20 20 |(+ x 1))| |
|00004b20| 20 20 20 20 20 20 20 20 | 20 20 5c 65 76 20 20 36 | | \ev 6|
|00004b30| 0a 0a 28 62 65 67 69 6e | 20 28 64 69 73 70 6c 61 |..(begin| (displa|
|00004b40| 79 20 22 34 20 70 6c 75 | 73 20 31 20 65 71 75 61 |y "4 plu|s 1 equa|
|00004b50| 6c 73 20 22 29 0a 20 20 | 20 20 20 20 20 28 64 69 |ls "). | (di|
|00004b60| 73 70 6c 61 79 20 28 2b | 20 34 20 31 29 29 29 20 |splay (+| 4 1))) |
|00004b70| 20 20 20 20 20 5c 65 76 | 20 20 5c 75 6e 73 70 65 | \ev| \unspe|
|00004b80| 63 69 66 69 65 64 0a 20 | 5c 3e 7b 5c 65 6d 20 61 |cified. |\>{\em a|
|00004b90| 6e 64 20 70 72 69 6e 74 | 73 7d 20 20 34 20 70 6c |nd print|s} 4 pl|
|00004ba0| 75 73 20 31 20 65 71 75 | 61 6c 73 20 35 25 0a 5c |us 1 equ|als 5%.\|
|00004bb0| 65 6e 64 7b 73 63 68 65 | 6d 65 7d 0a 0a 5c 62 65 |end{sche|me}..\be|
|00004bc0| 67 69 6e 7b 6e 6f 74 65 | 7d 0a 5c 63 69 74 65 7b |gin{note|}.\cite{|
|00004bd0| 53 49 43 50 7d 20 75 73 | 65 73 20 74 68 65 20 6b |SICP} us|es the k|
|00004be0| 65 79 77 6f 72 64 20 5c | 69 64 65 7b 73 65 71 75 |eyword \|ide{sequ|
|00004bf0| 65 6e 63 65 7d 20 69 6e | 73 74 65 61 64 20 6f 66 |ence} in|stead of|
|00004c00| 20 5c 69 64 65 7b 62 65 | 67 69 6e 7d 2e 0a 5c 65 | \ide{be|gin}..\e|
|00004c10| 6e 64 7b 6e 6f 74 65 7d | 0a 0a 5c 65 6e 64 7b 65 |nd{note}|..\end{e|
|00004c20| 6e 74 72 79 7d 0a 0a 0a | 5c 73 75 62 73 65 63 74 |ntry}...|\subsect|
|00004c30| 69 6f 6e 7b 49 74 65 72 | 61 74 69 6f 6e 7d 25 5c |ion{Iter|ation}%\|
|00004c40| 75 6e 73 65 63 74 69 6f | 6e 0a 0a 5c 6e 6f 69 6e |unsectio|n..\noin|
|00004c50| 64 65 6e 74 25 0a 5c 70 | 70 72 6f 74 6f 7b 28 64 |dent%.\p|proto{(d|
|00004c60| 6f 20 28 28 5c 68 79 70 | 65 72 69 7b 76 61 72 69 |o ((\hyp|eri{vari|
|00004c70| 61 62 6c 65 7d 20 5c 68 | 79 70 65 72 69 7b 69 6e |able} \h|yperi{in|
|00004c80| 69 74 7d 20 5c 68 79 70 | 65 72 69 7b 73 74 65 70 |it} \hyp|eri{step|
|00004c90| 7d 29 7d 7b 5c 65 78 70 | 72 74 79 70 65 7d 0a 5c |})}{\exp|rtype}.\|
|00004ca0| 6d 61 69 6e 73 63 68 69 | 6e 64 65 78 7b 64 6f 7d |mainschi|ndex{do}|
|00004cb0| 7b 5c 74 74 5c 6f 62 65 | 79 73 70 61 63 65 73 25 |{\tt\obe|yspaces%|
|00004cc0| 0a 20 20 20 20 20 5c 64 | 6f 74 73 66 6f 6f 29 5c |. \d|otsfoo)\|
|00004cd0| 5c 0a 20 20 20 20 28 5c | 68 79 70 65 72 7b 74 65 |\. (\|hyper{te|
|00004ce0| 73 74 7d 20 5c 68 79 70 | 65 72 7b 65 78 70 72 65 |st} \hyp|er{expre|
|00004cf0| 73 73 69 6f 6e 7d 20 5c | 64 6f 74 73 66 6f 6f 29 |ssion} \|dotsfoo)|
|00004d00| 5c 5c 0a 20 20 5c 68 79 | 70 65 72 7b 63 6f 6d 6d |\\. \hy|per{comm|
|00004d10| 61 6e 64 7d 20 5c 64 6f | 74 73 66 6f 6f 29 7d 0a |and} \do|tsfoo)}.|
|00004d20| 0a 5c 69 64 65 7b 44 6f | 7d 20 69 73 20 61 6e 20 |.\ide{Do|} is an |
|00004d30| 69 74 65 72 61 74 69 6f | 6e 20 63 6f 6e 73 74 72 |iteratio|n constr|
|00004d40| 75 63 74 2e 20 20 49 74 | 20 73 70 65 63 69 66 69 |uct. It| specifi|
|00004d50| 65 73 20 61 20 73 65 74 | 20 6f 66 20 76 61 72 69 |es a set| of vari|
|00004d60| 61 62 6c 65 73 20 74 6f | 0a 62 65 20 62 6f 75 6e |ables to|.be boun|
|00004d70| 64 2c 20 68 6f 77 20 74 | 68 65 79 20 61 72 65 20 |d, how t|hey are |
|00004d80| 74 6f 20 62 65 20 69 6e | 69 74 69 61 6c 69 7a 65 |to be in|itialize|
|00004d90| 64 20 61 74 20 74 68 65 | 20 73 74 61 72 74 2c 20 |d at the| start, |
|00004da0| 61 6e 64 20 68 6f 77 20 | 74 68 65 79 20 61 72 65 |and how |they are|
|00004db0| 0a 74 6f 20 62 65 20 75 | 70 64 61 74 65 64 20 6f |.to be u|pdated o|
|00004dc0| 6e 20 65 61 63 68 20 69 | 74 65 72 61 74 69 6f 6e |n each i|teration|
|00004dd0| 2e 20 20 57 68 65 6e 20 | 61 20 74 65 72 6d 69 6e |. When |a termin|
|00004de0| 61 74 69 6f 6e 20 63 6f | 6e 64 69 74 69 6f 6e 20 |ation co|ndition |
|00004df0| 69 73 20 6d 65 74 2c 0a | 74 68 65 20 6c 6f 6f 70 |is met,.|the loop|
|00004e00| 20 65 78 69 74 73 20 77 | 69 74 68 20 61 20 73 70 | exits w|ith a sp|
|00004e10| 65 63 69 66 69 65 64 20 | 72 65 73 75 6c 74 20 76 |ecified |result v|
|00004e20| 61 6c 75 65 2e 0a 0a 5c | 69 64 65 7b 44 6f 7d 20 |alue...\|ide{Do} |
|00004e30| 65 78 70 72 65 73 73 69 | 6f 6e 73 20 61 72 65 20 |expressi|ons are |
|00004e40| 65 76 61 6c 75 61 74 65 | 64 20 61 73 20 66 6f 6c |evaluate|d as fol|
|00004e50| 6c 6f 77 73 3a 0a 54 68 | 65 20 5c 68 79 70 65 72 |lows:.Th|e \hyper|
|00004e60| 7b 69 6e 69 74 7d 20 65 | 78 70 72 65 73 73 69 6f |{init} e|xpressio|
|00004e70| 6e 73 20 61 72 65 20 65 | 76 61 6c 75 61 74 65 64 |ns are e|valuated|
|00004e80| 20 28 69 6e 20 73 6f 6d | 65 20 75 6e 73 70 65 63 | (in som|e unspec|
|00004e90| 69 66 69 65 64 20 6f 72 | 64 65 72 29 2c 0a 74 68 |ified or|der),.th|
|00004ea0| 65 20 5c 68 79 70 65 72 | 7b 76 61 72 69 61 62 6c |e \hyper|{variabl|
|00004eb0| 65 7d 73 20 61 72 65 20 | 62 6f 75 6e 64 20 74 6f |e}s are |bound to|
|00004ec0| 20 66 72 65 73 68 20 6c | 6f 63 61 74 69 6f 6e 73 | fresh l|ocations|
|00004ed0| 2c 20 74 68 65 20 72 65 | 73 75 6c 74 73 20 6f 66 |, the re|sults of|
|00004ee0| 20 74 68 65 0a 5c 68 79 | 70 65 72 7b 69 6e 69 74 | the.\hy|per{init|
|00004ef0| 7d 20 65 78 70 72 65 73 | 73 69 6f 6e 73 20 61 72 |} expres|sions ar|
|00004f00| 65 20 73 74 6f 72 65 64 | 20 69 6e 20 74 68 65 20 |e stored| in the |
|00004f10| 62 69 6e 64 69 6e 67 73 | 20 6f 66 20 74 68 65 0a |bindings| of the.|
|00004f20| 5c 68 79 70 65 72 7b 76 | 61 72 69 61 62 6c 65 7d |\hyper{v|ariable}|
|00004f30| 73 2c 20 61 6e 64 20 74 | 68 65 6e 20 74 68 65 20 |s, and t|hen the |
|00004f40| 69 74 65 72 61 74 69 6f | 6e 20 70 68 61 73 65 20 |iteratio|n phase |
|00004f50| 62 65 67 69 6e 73 2e 0a | 0a 5c 76 65 73 74 20 45 |begins..|.\vest E|
|00004f60| 61 63 68 20 69 74 65 72 | 61 74 69 6f 6e 20 62 65 |ach iter|ation be|
|00004f70| 67 69 6e 73 20 62 79 20 | 65 76 61 6c 75 61 74 69 |gins by |evaluati|
|00004f80| 6e 67 20 5c 68 79 70 65 | 72 7b 74 65 73 74 7d 3b |ng \hype|r{test};|
|00004f90| 20 69 66 20 74 68 65 20 | 72 65 73 75 6c 74 20 69 | if the |result i|
|00004fa0| 73 0a 66 61 6c 73 65 20 | 28 73 65 65 20 73 65 63 |s.false |(see sec|
|00004fb0| 74 69 6f 6e 7e 5c 72 65 | 66 7b 62 6f 6f 6c 65 61 |tion~\re|f{boolea|
|00004fc0| 6e 73 65 63 74 69 6f 6e | 7d 29 2c 20 74 68 65 6e |nsection|}), then|
|00004fd0| 20 74 68 65 20 5c 68 79 | 70 65 72 7b 63 6f 6d 6d | the \hy|per{comm|
|00004fe0| 61 6e 64 7d 0a 65 78 70 | 72 65 73 73 69 6f 6e 73 |and}.exp|ressions|
|00004ff0| 20 61 72 65 20 65 76 61 | 6c 75 61 74 65 64 20 69 | are eva|luated i|
|00005000| 6e 20 6f 72 64 65 72 20 | 66 6f 72 20 65 66 66 65 |n order |for effe|
|00005010| 63 74 2c 20 74 68 65 20 | 5c 68 79 70 65 72 7b 73 |ct, the |\hyper{s|
|00005020| 74 65 70 7d 0a 65 78 70 | 72 65 73 73 69 6f 6e 73 |tep}.exp|ressions|
|00005030| 20 61 72 65 20 65 76 61 | 6c 75 61 74 65 64 20 69 | are eva|luated i|
|00005040| 6e 20 73 6f 6d 65 20 75 | 6e 73 70 65 63 69 66 69 |n some u|nspecifi|
|00005050| 65 64 20 6f 72 64 65 72 | 2c 20 74 68 65 0a 5c 68 |ed order|, the.\h|
|00005060| 79 70 65 72 7b 76 61 72 | 69 61 62 6c 65 7d 73 20 |yper{var|iable}s |
|00005070| 61 72 65 20 62 6f 75 6e | 64 20 74 6f 20 66 72 65 |are boun|d to fre|
|00005080| 73 68 20 6c 6f 63 61 74 | 69 6f 6e 73 2c 20 74 68 |sh locat|ions, th|
|00005090| 65 20 72 65 73 75 6c 74 | 73 20 6f 66 20 74 68 65 |e result|s of the|
|000050a0| 0a 5c 68 79 70 65 72 7b | 73 74 65 70 7d 73 20 61 |.\hyper{|step}s a|
|000050b0| 72 65 20 73 74 6f 72 65 | 64 20 69 6e 20 74 68 65 |re store|d in the|
|000050c0| 20 62 69 6e 64 69 6e 67 | 73 20 6f 66 20 74 68 65 | binding|s of the|
|000050d0| 0a 5c 68 79 70 65 72 7b | 76 61 72 69 61 62 6c 65 |.\hyper{|variable|
|000050e0| 7d 73 2c 20 61 6e 64 20 | 74 68 65 20 6e 65 78 74 |}s, and |the next|
|000050f0| 20 69 74 65 72 61 74 69 | 6f 6e 20 62 65 67 69 6e | iterati|on begin|
|00005100| 73 2e 0a 0a 5c 76 65 73 | 74 20 49 66 20 5c 68 79 |s...\ves|t If \hy|
|00005110| 70 65 72 7b 74 65 73 74 | 7d 20 65 76 61 6c 75 61 |per{test|} evalua|
|00005120| 74 65 73 20 74 6f 20 61 | 20 74 72 75 65 20 76 61 |tes to a| true va|
|00005130| 6c 75 65 2c 20 74 68 65 | 6e 20 74 68 65 0a 5c 68 |lue, the|n the.\h|
|00005140| 79 70 65 72 7b 65 78 70 | 72 65 73 73 69 6f 6e 7d |yper{exp|ression}|
|00005150| 73 20 61 72 65 20 65 76 | 61 6c 75 61 74 65 64 20 |s are ev|aluated |
|00005160| 66 72 6f 6d 20 6c 65 66 | 74 20 74 6f 20 72 69 67 |from lef|t to rig|
|00005170| 68 74 20 61 6e 64 20 74 | 68 65 20 76 61 6c 75 65 |ht and t|he value|
|00005180| 20 6f 66 0a 74 68 65 20 | 6c 61 73 74 20 5c 68 79 | of.the |last \hy|
|00005190| 70 65 72 7b 65 78 70 72 | 65 73 73 69 6f 6e 7d 20 |per{expr|ession} |
|000051a0| 69 73 20 72 65 74 75 72 | 6e 65 64 20 61 73 20 74 |is retur|ned as t|
|000051b0| 68 65 20 76 61 6c 75 65 | 20 6f 66 20 74 68 65 20 |he value| of the |
|000051c0| 5c 69 64 65 7b 64 6f 7d | 0a 65 78 70 72 65 73 73 |\ide{do}|.express|
|000051d0| 69 6f 6e 2e 20 20 49 66 | 20 6e 6f 20 5c 68 79 70 |ion. If| no \hyp|
|000051e0| 65 72 7b 65 78 70 72 65 | 73 73 69 6f 6e 7d 73 20 |er{expre|ssion}s |
|000051f0| 61 72 65 20 70 72 65 73 | 65 6e 74 2c 20 74 68 65 |are pres|ent, the|
|00005200| 6e 20 74 68 65 20 76 61 | 6c 75 65 20 6f 66 0a 74 |n the va|lue of.t|
|00005210| 68 65 20 5c 69 64 65 7b | 64 6f 7d 20 65 78 70 72 |he \ide{|do} expr|
|00005220| 65 73 73 69 6f 6e 20 69 | 73 20 75 6e 73 70 65 63 |ession i|s unspec|
|00005230| 69 66 69 65 64 2e 0a 0a | 5c 76 65 73 74 20 54 68 |ified...|\vest Th|
|00005240| 65 20 72 65 67 69 6f 6e | 5c 69 6e 64 65 78 7b 72 |e region|\index{r|
|00005250| 65 67 69 6f 6e 7d 20 6f | 66 20 74 68 65 20 62 69 |egion} o|f the bi|
|00005260| 6e 64 69 6e 67 20 6f 66 | 20 61 20 5c 68 79 70 65 |nding of| a \hype|
|00005270| 72 7b 76 61 72 69 61 62 | 6c 65 7d 0a 63 6f 6e 73 |r{variab|le}.cons|
|00005280| 69 73 74 73 20 6f 66 20 | 74 68 65 20 65 6e 74 69 |ists of |the enti|
|00005290| 72 65 20 5c 69 64 65 7b | 64 6f 7d 20 65 78 70 72 |re \ide{|do} expr|
|000052a0| 65 73 73 69 6f 6e 20 65 | 78 63 65 70 74 20 66 6f |ession e|xcept fo|
|000052b0| 72 20 74 68 65 20 5c 68 | 79 70 65 72 7b 69 6e 69 |r the \h|yper{ini|
|000052c0| 74 7d 73 2e 0a 49 74 20 | 69 73 20 61 6e 20 65 72 |t}s..It |is an er|
|000052d0| 72 6f 72 20 66 6f 72 20 | 61 20 5c 68 79 70 65 72 |ror for |a \hyper|
|000052e0| 7b 76 61 72 69 61 62 6c | 65 7d 20 74 6f 20 61 70 |{variabl|e} to ap|
|000052f0| 70 65 61 72 20 6d 6f 72 | 65 20 74 68 61 6e 20 6f |pear mor|e than o|
|00005300| 6e 63 65 20 69 6e 20 74 | 68 65 0a 6c 69 73 74 20 |nce in t|he.list |
|00005310| 6f 66 20 5c 69 64 65 7b | 64 6f 7d 20 76 61 72 69 |of \ide{|do} vari|
|00005320| 61 62 6c 65 73 2e 0a 0a | 5c 76 65 73 74 20 41 20 |ables...|\vest A |
|00005330| 5c 68 79 70 65 72 7b 73 | 74 65 70 7d 20 6d 61 79 |\hyper{s|tep} may|
|00005340| 20 62 65 20 6f 6d 69 74 | 74 65 64 2c 20 69 6e 20 | be omit|ted, in |
|00005350| 77 68 69 63 68 20 63 61 | 73 65 20 74 68 65 20 65 |which ca|se the e|
|00005360| 66 66 65 63 74 20 69 73 | 20 74 68 65 0a 73 61 6d |ffect is| the.sam|
|00005370| 65 20 61 73 20 69 66 20 | 7b 5c 63 66 28 5c 68 79 |e as if |{\cf(\hy|
|00005380| 70 65 72 7b 76 61 72 69 | 61 62 6c 65 7d 20 5c 68 |per{vari|able} \h|
|00005390| 79 70 65 72 7b 69 6e 69 | 74 7d 20 5c 68 79 70 65 |yper{ini|t} \hype|
|000053a0| 72 7b 76 61 72 69 61 62 | 6c 65 7d 29 7d 20 68 61 |r{variab|le})} ha|
|000053b0| 64 0a 62 65 65 6e 20 77 | 72 69 74 74 65 6e 20 69 |d.been w|ritten i|
|000053c0| 6e 73 74 65 61 64 20 6f | 66 20 7b 5c 63 66 28 5c |nstead o|f {\cf(\|
|000053d0| 68 79 70 65 72 7b 76 61 | 72 69 61 62 6c 65 7d 20 |hyper{va|riable} |
|000053e0| 5c 68 79 70 65 72 7b 69 | 6e 69 74 7d 29 7d 2e 0a |\hyper{i|nit})}..|
|000053f0| 0a 5c 62 65 67 69 6e 7b | 73 63 68 65 6d 65 7d 0a |.\begin{|scheme}.|
|00005400| 28 64 6f 20 28 28 76 65 | 63 20 28 6d 61 6b 65 2d |(do ((ve|c (make-|
|00005410| 76 65 63 74 6f 72 20 35 | 29 29 0a 20 20 20 20 20 |vector 5|)). |
|00005420| 28 69 20 30 20 28 2b 20 | 69 20 31 29 29 29 0a 20 |(i 0 (+ |i 1))). |
|00005430| 20 20 20 28 28 3d 20 69 | 20 35 29 20 76 65 63 29 | ((= i| 5) vec)|
|00005440| 0a 20 20 28 76 65 63 74 | 6f 72 2d 73 65 74 21 20 |. (vect|or-set! |
|00005450| 76 65 63 20 69 20 69 29 | 29 20 20 20 20 20 20 20 |vec i i)|) |
|00005460| 20 20 20 5c 65 76 20 20 | 5c 23 28 30 20 31 20 32 | \ev |\#(0 1 2|
|00005470| 20 33 20 34 29 0a 0a 28 | 6c 65 74 20 28 28 78 20 | 3 4)..(|let ((x |
|00005480| 27 28 31 20 33 20 35 20 | 37 20 39 29 29 29 0a 20 |'(1 3 5 |7 9))). |
|00005490| 20 28 64 6f 20 28 28 78 | 20 78 20 28 63 64 72 20 | (do ((x| x (cdr |
|000054a0| 78 29 29 0a 20 20 20 20 | 20 20 20 28 73 75 6d 20 |x)). | (sum |
|000054b0| 30 20 28 2b 20 73 75 6d | 20 28 63 61 72 20 78 29 |0 (+ sum| (car x)|
|000054c0| 29 29 29 0a 20 20 20 20 | 20 20 28 28 6e 75 6c 6c |))). | ((null|
|000054d0| 3f 20 78 29 20 73 75 6d | 29 29 29 20 20 20 20 20 |? x) sum|))) |
|000054e0| 20 20 20 20 20 20 20 20 | 5c 65 76 20 20 32 35 25 | |\ev 25%|
|000054f0| 0a 5c 65 6e 64 7b 73 63 | 68 65 6d 65 7d 0a 0a 25 |.\end{sc|heme}..%|
|00005500| 5c 65 6e 64 7b 65 6e 74 | 72 79 7d 0a 0a 0a 5c 62 |\end{ent|ry}...\b|
|00005510| 65 67 69 6e 7b 65 6e 74 | 72 79 7d 7b 25 0a 5c 70 |egin{ent|ry}{%.\p|
|00005520| 72 6f 74 6f 7b 6c 65 74 | 7d 7b 20 5c 68 79 70 65 |roto{let|}{ \hype|
|00005530| 72 7b 76 61 72 69 61 62 | 6c 65 7d 20 5c 68 79 70 |r{variab|le} \hyp|
|00005540| 65 72 7b 62 69 6e 64 69 | 6e 67 73 7d 20 5c 68 79 |er{bindi|ngs} \hy|
|00005550| 70 65 72 7b 62 6f 64 79 | 7d 7d 7b 5c 65 78 70 72 |per{body|}}{\expr|
|00005560| 74 79 70 65 7d 7d 0a 0a | 5c 6c 61 62 65 6c 7b 6e |type}}..|\label{n|
|00005570| 61 6d 65 64 6c 65 74 7d | 0a 53 6f 6d 65 20 69 6d |amedlet}|.Some im|
|00005580| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 73 20 6f 66 |plementa|tions of|
|00005590| 20 53 63 68 65 6d 65 20 | 70 65 72 6d 69 74 20 61 | Scheme |permit a|
|000055a0| 20 76 61 72 69 61 6e 74 | 20 6f 6e 20 74 68 65 20 | variant| on the |
|000055b0| 73 79 6e 74 61 78 20 6f | 66 0a 5c 69 64 65 7b 6c |syntax o|f.\ide{l|
|000055c0| 65 74 7d 20 63 61 6c 6c | 65 64 20 60 60 6e 61 6d |et} call|ed ``nam|
|000055d0| 65 64 20 5c 69 64 65 7b | 6c 65 74 7d 27 27 20 77 |ed \ide{|let}'' w|
|000055e0| 68 69 63 68 20 70 72 6f | 76 69 64 65 73 20 61 20 |hich pro|vides a |
|000055f0| 6d 6f 72 65 20 67 65 6e | 65 72 61 6c 0a 6c 6f 6f |more gen|eral.loo|
|00005600| 70 69 6e 67 20 63 6f 6e | 73 74 72 75 63 74 20 74 |ping con|struct t|
|00005610| 68 61 6e 20 5c 69 64 65 | 7b 64 6f 7d 2c 20 61 6e |han \ide|{do}, an|
|00005620| 64 20 6d 61 79 20 61 6c | 73 6f 20 62 65 20 75 73 |d may al|so be us|
|00005630| 65 64 20 74 6f 20 65 78 | 70 72 65 73 73 0a 72 65 |ed to ex|press.re|
|00005640| 63 75 72 73 69 6f 6e 73 | 2e 0a 0a 4e 61 6d 65 64 |cursions|...Named|
|00005650| 20 5c 69 64 65 7b 6c 65 | 74 7d 20 68 61 73 20 74 | \ide{le|t} has t|
|00005660| 68 65 20 73 61 6d 65 20 | 73 79 6e 74 61 78 20 61 |he same |syntax a|
|00005670| 6e 64 20 73 65 6d 61 6e | 74 69 63 73 20 61 73 20 |nd seman|tics as |
|00005680| 6f 72 64 69 6e 61 72 79 | 20 5c 69 64 65 7b 6c 65 |ordinary| \ide{le|
|00005690| 74 7d 0a 65 78 63 65 70 | 74 20 74 68 61 74 20 5c |t}.excep|t that \|
|000056a0| 68 79 70 65 72 7b 76 61 | 72 69 61 62 6c 65 7d 20 |hyper{va|riable} |
|000056b0| 69 73 20 62 6f 75 6e 64 | 20 77 69 74 68 69 6e 20 |is bound| within |
|000056c0| 5c 68 79 70 65 72 7b 62 | 6f 64 79 7d 20 74 6f 20 |\hyper{b|ody} to |
|000056d0| 61 20 70 72 6f 63 65 64 | 75 72 65 0a 77 68 6f 73 |a proced|ure.whos|
|000056e0| 65 20 66 6f 72 6d 61 6c | 20 61 72 67 75 6d 65 6e |e formal| argumen|
|000056f0| 74 73 20 61 72 65 20 74 | 68 65 20 62 6f 75 6e 64 |ts are t|he bound|
|00005700| 20 76 61 72 69 61 62 6c | 65 73 20 61 6e 64 20 77 | variabl|es and w|
|00005710| 68 6f 73 65 20 62 6f 64 | 79 20 69 73 0a 5c 68 79 |hose bod|y is.\hy|
|00005720| 70 65 72 7b 62 6f 64 79 | 7d 2e 20 20 54 68 75 73 |per{body|}. Thus|
|00005730| 20 74 68 65 20 65 78 65 | 63 75 74 69 6f 6e 20 6f | the exe|cution o|
|00005740| 66 20 5c 68 79 70 65 72 | 7b 62 6f 64 79 7d 20 6d |f \hyper|{body} m|
|00005750| 61 79 20 62 65 20 72 65 | 70 65 61 74 65 64 20 62 |ay be re|peated b|
|00005760| 79 0a 69 6e 76 6f 6b 69 | 6e 67 20 74 68 65 20 70 |y.invoki|ng the p|
|00005770| 72 6f 63 65 64 75 72 65 | 20 6e 61 6d 65 64 20 62 |rocedure| named b|
|00005780| 79 20 5c 68 79 70 65 72 | 7b 76 61 72 69 61 62 6c |y \hyper|{variabl|
|00005790| 65 7d 2e 0a 0a 25 20 20 | 20 20 20 20 20 20 20 20 |e}...% | |
|000057a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000057b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000057c0| 20 20 20 20 7c 20 20 3c | 2d 2d 20 72 69 67 68 74 | | <|-- right|
|000057d0| 20 6d 61 72 67 69 6e 0a | 5c 62 65 67 69 6e 7b 73 | margin.|\begin{s|
|000057e0| 63 68 65 6d 65 7d 0a 28 | 6c 65 74 20 6c 6f 6f 70 |cheme}.(|let loop|
|000057f0| 20 28 28 6e 75 6d 62 65 | 72 73 20 27 28 33 20 2d | ((numbe|rs '(3 -|
|00005800| 32 20 31 20 36 20 2d 35 | 29 29 0a 20 20 20 20 20 |2 1 6 -5|)). |
|00005810| 20 20 20 20 20 20 28 6e | 6f 6e 6e 65 67 20 27 28 | (n|onneg '(|
|00005820| 29 29 0a 20 20 20 20 20 | 20 20 20 20 20 20 28 6e |)). | (n|
|00005830| 65 67 20 27 28 29 29 29 | 0a 20 20 28 63 6f 6e 64 |eg '()))|. (cond|
|00005840| 20 28 28 6e 75 6c 6c 3f | 20 6e 75 6d 62 65 72 73 | ((null?| numbers|
|00005850| 29 20 28 6c 69 73 74 20 | 6e 6f 6e 6e 65 67 20 6e |) (list |nonneg n|
|00005860| 65 67 29 29 0a 20 20 20 | 20 20 20 20 20 28 28 3e |eg)). | ((>|
|00005870| 3d 20 28 63 61 72 20 6e | 75 6d 62 65 72 73 29 20 |= (car n|umbers) |
|00005880| 30 29 0a 20 20 20 20 20 | 20 20 20 20 28 6c 6f 6f |0). | (loo|
|00005890| 70 20 28 63 64 72 20 6e | 75 6d 62 65 72 73 29 0a |p (cdr n|umbers).|
|000058a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 28 | | (|
|000058b0| 63 6f 6e 73 20 28 63 61 | 72 20 6e 75 6d 62 65 72 |cons (ca|r number|
|000058c0| 73 29 20 6e 6f 6e 6e 65 | 67 29 0a 20 20 20 20 20 |s) nonne|g). |
|000058d0| 20 20 20 20 20 20 20 20 | 20 20 6e 65 67 29 29 0a | | neg)).|
|000058e0| 20 20 20 20 20 20 20 20 | 28 28 3c 20 28 63 61 72 | |((< (car|
|000058f0| 20 6e 75 6d 62 65 72 73 | 29 20 30 29 0a 20 20 20 | numbers|) 0). |
|00005900| 20 20 20 20 20 20 28 6c | 6f 6f 70 20 28 63 64 72 | (l|oop (cdr|
|00005910| 20 6e 75 6d 62 65 72 73 | 29 0a 20 20 20 20 20 20 | numbers|). |
|00005920| 20 20 20 20 20 20 20 20 | 20 6e 6f 6e 6e 65 67 0a | | nonneg.|
|00005930| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 28 | | (|
|00005940| 63 6f 6e 73 20 28 63 61 | 72 20 6e 75 6d 62 65 72 |cons (ca|r number|
|00005950| 73 29 20 6e 65 67 29 29 | 29 29 29 20 25 0a 20 20 |s) neg))|))) %. |
|00005960| 5c 6c 65 76 20 20 28 28 | 36 20 31 20 33 29 20 28 |\lev ((|6 1 3) (|
|00005970| 2d 35 20 2d 32 29 29 25 | 0a 5c 65 6e 64 7b 73 63 |-5 -2))%|.\end{sc|
|00005980| 68 65 6d 65 7d 0a 0a 5c | 65 6e 64 7b 65 6e 74 72 |heme}..\|end{entr|
|00005990| 79 7d 0a 0a 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |y}...\su|bsection|
|000059a0| 7b 44 65 6c 61 79 65 64 | 20 65 76 61 6c 75 61 74 |{Delayed| evaluat|
|000059b0| 69 6f 6e 7d 5c 75 6e 73 | 65 63 74 69 6f 6e 0a 5c |ion}\uns|ection.\|
|000059c0| 6c 61 62 65 6c 7b 64 65 | 6c 61 79 7d 0a 0a 5c 62 |label{de|lay}..\b|
|000059d0| 65 67 69 6e 7b 65 6e 74 | 72 79 7d 7b 25 0a 5c 70 |egin{ent|ry}{%.\p|
|000059e0| 72 6f 74 6f 7b 64 65 6c | 61 79 7d 7b 20 5c 68 79 |roto{del|ay}{ \hy|
|000059f0| 70 65 72 7b 65 78 70 72 | 65 73 73 69 6f 6e 7d 7d |per{expr|ession}}|
|00005a00| 7b 5c 65 78 70 72 74 79 | 70 65 7d 7d 0a 0a 5c 74 |{\exprty|pe}}..\t|
|00005a10| 6f 64 6f 7b 46 69 78 2e | 7d 0a 0a 54 68 65 20 5c |odo{Fix.|}..The \|
|00005a20| 69 64 65 7b 64 65 6c 61 | 79 7d 20 63 6f 6e 73 74 |ide{dela|y} const|
|00005a30| 72 75 63 74 20 69 73 20 | 75 73 65 64 20 74 6f 67 |ruct is |used tog|
|00005a40| 65 74 68 65 72 20 77 69 | 74 68 20 74 68 65 20 70 |ether wi|th the p|
|00005a50| 72 6f 63 65 64 75 72 65 | 20 5c 69 64 65 7b 66 6f |rocedure| \ide{fo|
|00005a60| 72 63 65 7d 20 74 6f 0a | 69 6d 70 6c 65 6d 65 6e |rce} to.|implemen|
|00005a70| 74 20 5c 64 65 66 69 6e | 69 6e 67 7b 6c 61 7a 79 |t \defin|ing{lazy|
|00005a80| 20 65 76 61 6c 75 61 74 | 69 6f 6e 7d 20 6f 72 20 | evaluat|ion} or |
|00005a90| 5c 64 65 66 69 6e 69 6e | 67 7b 63 61 6c 6c 20 62 |\definin|g{call b|
|00005aa0| 79 20 6e 65 65 64 7d 2e | 0a 7b 5c 74 74 28 64 65 |y need}.|.{\tt(de|
|00005ab0| 6c 61 79 20 5c 68 79 70 | 65 72 7b 65 78 70 72 65 |lay \hyp|er{expre|
|00005ac0| 73 73 69 6f 6e 7d 29 7d | 20 72 65 74 75 72 6e 73 |ssion})}| returns|
|00005ad0| 20 61 6e 20 6f 62 6a 65 | 63 74 20 63 61 6c 6c 65 | an obje|ct calle|
|00005ae0| 64 20 61 0a 5c 64 65 66 | 69 6e 69 6e 67 7b 70 72 |d a.\def|ining{pr|
|00005af0| 6f 6d 69 73 65 7d 20 77 | 68 69 63 68 20 61 74 20 |omise} w|hich at |
|00005b00| 73 6f 6d 65 20 70 6f 69 | 6e 74 20 69 6e 20 74 68 |some poi|nt in th|
|00005b10| 65 20 66 75 74 75 72 65 | 20 6d 61 79 20 62 65 20 |e future| may be |
|00005b20| 61 73 6b 65 64 20 28 62 | 79 0a 74 68 65 20 5c 69 |asked (b|y.the \i|
|00005b30| 64 65 7b 66 6f 72 63 65 | 7d 20 70 72 6f 63 65 64 |de{force|} proced|
|00005b40| 75 72 65 29 20 5c 74 6f | 64 6f 7b 42 61 72 74 6c |ure) \to|do{Bartl|
|00005b50| 65 79 27 73 20 77 68 69 | 74 65 20 6c 69 65 3b 20 |ey's whi|te lie; |
|00005b60| 4f 4b 3f 7d 20 74 6f 20 | 65 76 61 6c 75 61 74 65 |OK?} to |evaluate|
|00005b70| 0a 5c 68 79 70 65 72 7b | 65 78 70 72 65 73 73 69 |.\hyper{|expressi|
|00005b80| 6f 6e 7d 20 61 6e 64 20 | 64 65 6c 69 76 65 72 20 |on} and |deliver |
|00005b90| 74 68 65 20 72 65 73 75 | 6c 74 69 6e 67 20 76 61 |the resu|lting va|
|00005ba0| 6c 75 65 2e 0a 0a 53 65 | 65 20 74 68 65 20 64 65 |lue...Se|e the de|
|00005bb0| 73 63 72 69 70 74 69 6f | 6e 20 6f 66 20 5c 69 64 |scriptio|n of \id|
|00005bc0| 65 7b 66 6f 72 63 65 7d | 20 28 73 65 63 74 69 6f |e{force}| (sectio|
|00005bd0| 6e 7e 5c 72 65 66 7b 66 | 6f 72 63 65 7d 29 20 66 |n~\ref{f|orce}) f|
|00005be0| 6f 72 20 61 0a 6d 6f 72 | 65 20 63 6f 6d 70 6c 65 |or a.mor|e comple|
|00005bf0| 74 65 20 64 65 73 63 72 | 69 70 74 69 6f 6e 20 6f |te descr|iption o|
|00005c00| 66 20 5c 69 64 65 7b 64 | 65 6c 61 79 7d 2e 0a 0a |f \ide{d|elay}...|
|00005c10| 5c 65 6e 64 7b 65 6e 74 | 72 79 7d 0a 0a 0a 5c 73 |\end{ent|ry}...\s|
|00005c20| 75 62 73 65 63 74 69 6f | 6e 7b 51 75 61 73 69 71 |ubsectio|n{Quasiq|
|00005c30| 75 6f 74 61 74 69 6f 6e | 7d 5c 75 6e 73 65 63 74 |uotation|}\unsect|
|00005c40| 69 6f 6e 0a 5c 6c 61 62 | 65 6c 7b 71 75 61 73 69 |ion.\lab|el{quasi|
|00005c50| 71 75 6f 74 65 73 65 63 | 74 69 6f 6e 7d 0a 0a 5c |quotesec|tion}..\|
|00005c60| 62 65 67 69 6e 7b 65 6e | 74 72 79 7d 7b 25 0a 5c |begin{en|try}{%.\|
|00005c70| 70 72 6f 74 6f 7b 71 75 | 61 73 69 71 75 6f 74 65 |proto{qu|asiquote|
|00005c80| 7d 7b 20 5c 68 79 70 65 | 72 7b 74 65 6d 70 6c 61 |}{ \hype|r{templa|
|00005c90| 74 65 7d 7d 7b 65 73 73 | 65 6e 74 69 61 6c 20 5c |te}}{ess|ential \|
|00005ca0| 65 78 70 72 74 79 70 65 | 7d 20 5c 6e 6f 70 61 67 |exprtype|} \nopag|
|00005cb0| 65 62 72 65 61 6b 0a 5c | 70 70 72 6f 74 6f 7b 5c |ebreak.\|pproto{\|
|00005cc0| 62 61 63 6b 71 75 6f 74 | 65 5c 68 79 70 65 72 7b |backquot|e\hyper{|
|00005cd0| 74 65 6d 70 6c 61 74 65 | 7d 7d 7b 65 73 73 65 6e |template|}}{essen|
|00005ce0| 74 69 61 6c 20 5c 65 78 | 70 72 74 79 70 65 7d 7d |tial \ex|prtype}}|
|00005cf0| 0a 0a 60 60 42 61 63 6b | 71 75 6f 74 65 27 27 20 |..``Back|quote'' |
|00005d00| 6f 72 20 60 60 71 75 61 | 73 69 71 75 6f 74 65 27 |or ``qua|siquote'|
|00005d10| 27 5c 69 6e 64 65 78 7b | 62 61 63 6b 71 75 6f 74 |'\index{|backquot|
|00005d20| 65 7d 20 65 78 70 72 65 | 73 73 69 6f 6e 73 20 61 |e} expre|ssions a|
|00005d30| 72 65 20 75 73 65 66 75 | 6c 0a 66 6f 72 20 63 6f |re usefu|l.for co|
|00005d40| 6e 73 74 72 75 63 74 69 | 6e 67 20 61 20 6c 69 73 |nstructi|ng a lis|
|00005d50| 74 20 6f 72 20 76 65 63 | 74 6f 72 20 73 74 72 75 |t or vec|tor stru|
|00005d60| 63 74 75 72 65 20 77 68 | 65 6e 20 6d 6f 73 74 20 |cture wh|en most |
|00005d70| 62 75 74 20 6e 6f 74 20 | 61 6c 6c 20 6f 66 20 74 |but not |all of t|
|00005d80| 68 65 0a 64 65 73 69 72 | 65 64 20 73 74 72 75 63 |he.desir|ed struc|
|00005d90| 74 75 72 65 20 69 73 20 | 6b 6e 6f 77 6e 20 69 6e |ture is |known in|
|00005da0| 20 61 64 76 61 6e 63 65 | 2e 20 20 49 66 20 6e 6f | advance|. If no|
|00005db0| 0a 63 6f 6d 6d 61 73 5c | 69 6e 64 65 78 7b 63 6f |.commas\|index{co|
|00005dc0| 6d 6d 61 7d 20 61 70 70 | 65 61 72 20 77 69 74 68 |mma} app|ear with|
|00005dd0| 69 6e 20 74 68 65 20 5c | 68 79 70 65 72 7b 74 65 |in the \|hyper{te|
|00005de0| 6d 70 6c 61 74 65 7d 2c | 20 74 68 65 20 72 65 73 |mplate},| the res|
|00005df0| 75 6c 74 20 6f 66 20 65 | 76 61 6c 75 61 74 69 6e |ult of e|valuatin|
|00005e00| 67 0a 5c 62 61 63 6b 71 | 75 6f 74 65 5c 68 79 70 |g.\backq|uote\hyp|
|00005e10| 65 72 7b 74 65 6d 70 6c | 61 74 65 7d 20 69 73 20 |er{templ|ate} is |
|00005e20| 65 71 75 69 76 61 6c 65 | 6e 74 20 74 6f 20 74 68 |equivale|nt to th|
|00005e30| 65 20 72 65 73 75 6c 74 | 20 6f 66 20 65 76 61 6c |e result| of eval|
|00005e40| 75 61 74 69 6e 67 0a 5c | 73 69 6e 67 6c 65 71 75 |uating.\|singlequ|
|00005e50| 6f 74 65 5c 68 79 70 65 | 72 7b 74 65 6d 70 6c 61 |ote\hype|r{templa|
|00005e60| 74 65 7d 2e 20 20 49 66 | 20 61 20 63 6f 6d 6d 61 |te}. If| a comma|
|00005e70| 5c 6d 61 69 6e 73 63 68 | 69 6e 64 65 78 7b 2c 7d |\mainsch|index{,}|
|00005e80| 20 61 70 70 65 61 72 73 | 20 77 69 74 68 69 6e 20 | appears| within |
|00005e90| 74 68 65 0a 5c 68 79 70 | 65 72 7b 74 65 6d 70 6c |the.\hyp|er{templ|
|00005ea0| 61 74 65 7d 2c 20 68 6f | 77 65 76 65 72 2c 20 74 |ate}, ho|wever, t|
|00005eb0| 68 65 20 65 78 70 72 65 | 73 73 69 6f 6e 20 66 6f |he expre|ssion fo|
|00005ec0| 6c 6c 6f 77 69 6e 67 20 | 74 68 65 20 63 6f 6d 6d |llowing |the comm|
|00005ed0| 61 20 69 73 0a 65 76 61 | 6c 75 61 74 65 64 20 28 |a is.eva|luated (|
|00005ee0| 60 60 75 6e 71 75 6f 74 | 65 64 27 27 29 20 61 6e |``unquot|ed'') an|
|00005ef0| 64 20 69 74 73 20 72 65 | 73 75 6c 74 20 69 73 20 |d its re|sult is |
|00005f00| 69 6e 73 65 72 74 65 64 | 20 69 6e 74 6f 20 74 68 |inserted| into th|
|00005f10| 65 20 73 74 72 75 63 74 | 75 72 65 0a 69 6e 73 74 |e struct|ure.inst|
|00005f20| 65 61 64 20 6f 66 20 74 | 68 65 20 63 6f 6d 6d 61 |ead of t|he comma|
|00005f30| 20 61 6e 64 20 74 68 65 | 20 65 78 70 72 65 73 73 | and the| express|
|00005f40| 69 6f 6e 2e 20 20 49 66 | 20 61 20 63 6f 6d 6d 61 |ion. If| a comma|
|00005f50| 20 61 70 70 65 61 72 73 | 20 66 6f 6c 6c 6f 77 65 | appears| followe|
|00005f60| 64 0a 69 6d 6d 65 64 69 | 61 74 65 6c 79 20 62 79 |d.immedi|ately by|
|00005f70| 20 61 6e 20 61 74 2d 73 | 69 67 6e 20 28 5c 61 74 | an at-s|ign (\at|
|00005f80| 73 69 67 6e 29 2c 5c 69 | 6e 64 65 78 7b 61 74 2d |sign),\i|ndex{at-|
|00005f90| 73 69 67 6e 7d 20 74 68 | 65 6e 20 74 68 65 20 66 |sign} th|en the f|
|00005fa0| 6f 6c 6c 6f 77 69 6e 67 | 0a 65 78 70 72 65 73 73 |ollowing|.express|
|00005fb0| 69 6f 6e 20 6d 75 73 74 | 20 65 76 61 6c 75 61 74 |ion must| evaluat|
|00005fc0| 65 20 74 6f 20 61 20 6c | 69 73 74 3b 20 74 68 65 |e to a l|ist; the|
|00005fd0| 20 6f 70 65 6e 69 6e 67 | 20 61 6e 64 20 63 6c 6f | opening| and clo|
|00005fe0| 73 69 6e 67 20 70 61 72 | 65 6e 74 68 65 73 65 73 |sing par|entheses|
|00005ff0| 0a 6f 66 20 74 68 65 20 | 6c 69 73 74 20 61 72 65 |.of the |list are|
|00006000| 20 74 68 65 6e 20 60 60 | 73 74 72 69 70 70 65 64 | then ``|stripped|
|00006010| 20 61 77 61 79 27 27 20 | 61 6e 64 20 74 68 65 20 | away'' |and the |
|00006020| 65 6c 65 6d 65 6e 74 73 | 20 6f 66 20 74 68 65 20 |elements| of the |
|00006030| 6c 69 73 74 20 61 72 65 | 0a 69 6e 73 65 72 74 65 |list are|.inserte|
|00006040| 64 20 69 6e 20 70 6c 61 | 63 65 20 6f 66 20 74 68 |d in pla|ce of th|
|00006050| 65 20 63 6f 6d 6d 61 20 | 61 74 2d 73 69 67 6e 20 |e comma |at-sign |
|00006060| 65 78 70 72 65 73 73 69 | 6f 6e 20 73 65 71 75 65 |expressi|on seque|
|00006070| 6e 63 65 2e 0a 0a 25 20 | 73 74 72 75 63 6b 3a 20 |nce...% |struck: |
|00006080| 22 28 69 6e 20 74 68 65 | 20 73 65 6e 73 65 20 6f |"(in the| sense o|
|00006090| 66 20 5c 69 64 65 7b 65 | 71 75 61 6c 3f 7d 29 22 |f \ide{e|qual?})"|
|000060a0| 20 61 66 74 65 72 20 22 | 65 71 75 69 76 61 6c 65 | after "|equivale|
|000060b0| 6e 74 22 0a 0a 5c 62 65 | 67 69 6e 7b 73 63 68 65 |nt"..\be|gin{sche|
|000060c0| 6d 65 7d 0a 60 28 6c 69 | 73 74 20 2c 28 2b 20 31 |me}.`(li|st ,(+ 1|
|000060d0| 20 32 29 20 34 29 20 20 | 5c 65 76 20 20 28 6c 69 | 2) 4) |\ev (li|
|000060e0| 73 74 20 33 20 34 29 0a | 28 6c 65 74 20 28 28 6e |st 3 4).|(let ((n|
|000060f0| 61 6d 65 20 27 61 29 29 | 20 60 28 6c 69 73 74 20 |ame 'a))| `(list |
|00006100| 2c 6e 61 6d 65 20 27 2c | 6e 61 6d 65 29 29 20 25 |,name ',|name)) %|
|00006110| 0a 20 20 20 20 20 20 20 | 20 20 20 5c 6c 65 76 20 |. | \lev |
|00006120| 20 28 6c 69 73 74 20 61 | 20 28 71 75 6f 74 65 20 | (list a| (quote |
|00006130| 61 29 29 0a 60 28 61 20 | 2c 28 2b 20 31 20 32 29 |a)).`(a |,(+ 1 2)|
|00006140| 20 2c 40 28 6d 61 70 20 | 61 62 73 20 27 28 34 20 | ,@(map |abs '(4 |
|00006150| 2d 35 20 36 29 29 20 62 | 29 20 25 0a 20 20 20 20 |-5 6)) b|) %. |
|00006160| 20 20 20 20 20 20 5c 6c | 65 76 20 20 28 61 20 33 | \l|ev (a 3|
|00006170| 20 34 20 35 20 36 20 62 | 29 0a 60 28 28 5c 69 64 | 4 5 6 b|).`((\id|
|00006180| 65 7b 66 6f 6f 7d 20 2c | 28 2d 20 31 30 20 33 29 |e{foo} ,|(- 10 3)|
|00006190| 29 20 2c 40 28 63 64 72 | 20 27 28 63 29 29 20 2e |) ,@(cdr| '(c)) .|
|000061a0| 20 2c 28 63 61 72 20 27 | 28 63 6f 6e 73 29 29 29 | ,(car '|(cons)))|
|000061b0| 20 25 0a 20 20 20 20 20 | 20 20 20 20 20 5c 6c 65 | %. | \le|
|000061c0| 76 20 20 28 28 66 6f 6f | 20 37 29 20 2e 20 63 6f |v ((foo| 7) . co|
|000061d0| 6e 73 29 0a 60 5c 23 28 | 31 30 20 35 20 2c 28 73 |ns).`\#(|10 5 ,(s|
|000061e0| 71 72 74 20 34 29 20 2c | 40 28 6d 61 70 20 73 71 |qrt 4) ,|@(map sq|
|000061f0| 72 74 20 27 28 31 36 20 | 39 29 29 20 38 29 20 25 |rt '(16 |9)) 8) %|
|00006200| 0a 20 20 20 20 20 20 20 | 20 20 20 5c 6c 65 76 20 |. | \lev |
|00006210| 20 5c 23 28 31 30 20 35 | 20 32 20 34 20 33 20 38 | \#(10 5| 2 4 3 8|
|00006220| 29 25 0a 5c 65 6e 64 7b | 73 63 68 65 6d 65 7d 0a |)%.\end{|scheme}.|
|00006230| 0a 51 75 61 73 69 71 75 | 6f 74 65 20 66 6f 72 6d |.Quasiqu|ote form|
|00006240| 73 20 6d 61 79 20 62 65 | 20 6e 65 73 74 65 64 2e |s may be| nested.|
|00006250| 20 20 53 75 62 73 74 69 | 74 75 74 69 6f 6e 73 20 | Substi|tutions |
|00006260| 61 72 65 20 6d 61 64 65 | 20 6f 6e 6c 79 20 66 6f |are made| only fo|
|00006270| 72 0a 75 6e 71 75 6f 74 | 65 64 20 63 6f 6d 70 6f |r.unquot|ed compo|
|00006280| 6e 65 6e 74 73 20 61 70 | 70 65 61 72 69 6e 67 20 |nents ap|pearing |
|00006290| 61 74 20 74 68 65 20 73 | 61 6d 65 20 6e 65 73 74 |at the s|ame nest|
|000062a0| 69 6e 67 20 6c 65 76 65 | 6c 0a 61 73 20 74 68 65 |ing leve|l.as the|
|000062b0| 20 6f 75 74 65 72 6d 6f | 73 74 20 62 61 63 6b 71 | outermo|st backq|
|000062c0| 75 6f 74 65 2e 20 20 54 | 68 65 20 6e 65 73 74 69 |uote. T|he nesti|
|000062d0| 6e 67 20 6c 65 76 65 6c | 20 69 6e 63 72 65 61 73 |ng level| increas|
|000062e0| 65 73 20 62 79 20 6f 6e | 65 20 69 6e 73 69 64 65 |es by on|e inside|
|000062f0| 0a 65 61 63 68 20 73 75 | 63 63 65 73 73 69 76 65 |.each su|ccessive|
|00006300| 20 71 75 61 73 69 71 75 | 6f 74 61 74 69 6f 6e 2c | quasiqu|otation,|
|00006310| 20 61 6e 64 20 64 65 63 | 72 65 61 73 65 73 20 62 | and dec|reases b|
|00006320| 79 20 6f 6e 65 20 69 6e | 73 69 64 65 20 65 61 63 |y one in|side eac|
|00006330| 68 0a 75 6e 71 75 6f 74 | 61 74 69 6f 6e 2e 0a 0a |h.unquot|ation...|
|00006340| 5c 62 65 67 69 6e 7b 73 | 63 68 65 6d 65 7d 0a 60 |\begin{s|cheme}.`|
|00006350| 28 61 20 60 28 62 20 2c | 28 2b 20 31 20 32 29 20 |(a `(b ,|(+ 1 2) |
|00006360| 2c 28 66 6f 6f 20 2c 28 | 2b 20 31 20 33 29 20 64 |,(foo ,(|+ 1 3) d|
|00006370| 29 20 65 29 20 66 29 20 | 25 0a 20 20 20 20 20 20 |) e) f) |%. |
|00006380| 20 20 20 20 5c 6c 65 76 | 20 20 28 61 20 60 28 62 | \lev| (a `(b|
|00006390| 20 2c 28 2b 20 31 20 32 | 29 20 2c 28 66 6f 6f 20 | ,(+ 1 2|) ,(foo |
|000063a0| 34 20 64 29 20 65 29 20 | 66 29 0a 28 6c 65 74 20 |4 d) e) |f).(let |
|000063b0| 28 28 6e 61 6d 65 31 20 | 27 78 29 0a 20 20 20 20 |((name1 |'x). |
|000063c0| 20 20 28 6e 61 6d 65 32 | 20 27 79 29 29 0a 20 20 | (name2| 'y)). |
|000063d0| 60 28 61 20 60 28 62 20 | 2c 2c 6e 61 6d 65 31 20 |`(a `(b |,,name1 |
|000063e0| 2c 27 2c 6e 61 6d 65 32 | 20 64 29 20 65 29 29 20 |,',name2| d) e)) |
|000063f0| 25 0a 20 20 20 20 20 20 | 20 20 20 20 5c 6c 65 76 |%. | \lev|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.