home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / scheme / schmrprt / r395rs.lha / expr.tex < prev    next >
LaTeX Document  |  1989-03-12  |  25.4 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 | 0a 0a 5c 62 65 67 69 6e |me code.|..\begin|
|000006c0| 7b 73 63 68 65 6d 65 7d | 25 0a 28 71 75 6f 74 65 |{scheme}|%.(quote|
|000006d0| 20 61 29 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | a) | |
|000006e0| 20 20 20 20 20 20 20 20 | 5c 65 76 20 20 61 0a 28 | |\ev a.(|
|000006f0| 71 75 6f 74 65 20 5c 73 | 68 61 72 70 73 69 67 6e |quote \s|harpsign|
|00000700| 28 61 20 62 20 63 29 29 | 20 20 20 20 20 5c 65 76 |(a b c))| \ev|
|00000710| 20 20 5c 23 28 61 20 62 | 20 63 29 0a 28 71 75 6f | \#(a b| c).(quo|
|00000720| 74 65 20 28 2b 20 31 20 | 32 29 29 20 20 20 20 20 |te (+ 1 |2)) |
|00000730| 20 20 20 20 20 20 20 20 | 20 20 5c 65 76 20 20 28 | | \ev (|
|00000740| 2b 20 31 20 32 29 25 0a | 5c 65 6e 64 7b 73 63 68 |+ 1 2)%.|\end{sch|
|00000750| 65 6d 65 7d 0a 0a 7b 5c | 63 66 20 28 71 75 6f 74 |eme}..{\|cf (quot|
|00000760| 65 20 5c 68 79 70 65 72 | 7b 64 61 74 75 6d 7d 29 |e \hyper|{datum})|
|00000770| 7d 20 6d 61 79 20 62 65 | 20 61 62 62 72 65 76 69 |} may be| abbrevi|
|00000780| 61 74 65 64 20 61 73 0a | 5c 73 69 6e 67 6c 65 71 |ated as.|\singleq|
|00000790| 75 6f 74 65 5c 68 79 70 | 65 72 7b 64 61 74 75 6d |uote\hyp|er{datum|
|000007a0| 7d 2e 20 20 54 68 65 20 | 74 77 6f 20 6e 6f 74 61 |}. The |two nota|
|000007b0| 74 69 6f 6e 73 20 61 72 | 65 20 65 71 75 69 76 61 |tions ar|e equiva|
|000007c0| 6c 65 6e 74 20 69 6e 20 | 61 6c 6c 0a 72 65 73 70 |lent in |all.resp|
|000007d0| 65 63 74 73 2e 0a 0a 5c | 62 65 67 69 6e 7b 73 63 |ects...\|begin{sc|
|000007e0| 68 65 6d 65 7d 0a 27 61 | 20 20 20 20 20 20 20 20 |heme}.'a| |
|000007f0| 20 20 20 20 20 20 20 20 | 20 20 20 5c 65 76 20 20 | | \ev |
|00000800| 61 0a 27 5c 23 28 61 20 | 62 20 63 29 20 20 20 20 |a.'\#(a |b c) |
|00000810| 20 20 20 20 20 20 20 5c | 65 76 20 20 5c 23 28 61 | \|ev \#(a|
|00000820| 20 62 20 63 29 0a 27 28 | 2b 20 31 20 32 29 20 20 | b c).'(|+ 1 2) |
|00000830| 20 20 20 20 20 20 20 20 | 20 20 20 5c 65 76 20 20 | | \ev |
|00000840| 28 2b 20 31 20 32 29 0a | 27 28 71 75 6f 74 65 20 |(+ 1 2).|'(quote |
|00000850| 61 29 20 20 20 20 20 20 | 20 20 20 20 20 5c 65 76 |a) | \ev|
|00000860| 20 20 28 71 75 6f 74 65 | 20 61 29 0a 27 27 61 20 | (quote| a).''a |
|00000870| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000880| 20 5c 65 76 20 20 28 71 | 75 6f 74 65 20 61 29 25 | \ev (q|uote a)%|
|00000890| 0a 5c 65 6e 64 7b 73 63 | 68 65 6d 65 7d 0a 0a 4e |.\end{sc|heme}..N|
|000008a0| 75 6d 65 72 69 63 20 63 | 6f 6e 73 74 61 6e 74 73 |umeric c|onstants|
|000008b0| 2c 20 73 74 72 69 6e 67 | 20 63 6f 6e 73 74 61 6e |, string| constan|
|000008c0| 74 73 2c 20 63 68 61 72 | 61 63 74 65 72 20 63 6f |ts, char|acter co|
|000008d0| 6e 73 74 61 6e 74 73 2c | 20 61 6e 64 20 62 6f 6f |nstants,| and boo|
|000008e0| 6c 65 61 6e 0a 63 6f 6e | 73 74 61 6e 74 73 20 65 |lean.con|stants e|
|000008f0| 76 61 6c 75 61 74 65 20 | 60 60 74 6f 20 74 68 65 |valuate |``to the|
|00000900| 6d 73 65 6c 76 65 73 27 | 27 3b 20 74 68 65 79 20 |mselves'|'; they |
|00000910| 6e 65 65 64 20 6e 6f 74 | 20 62 65 20 71 75 6f 74 |need not| be quot|
|00000920| 65 64 2e 0a 0a 5c 62 65 | 67 69 6e 7b 73 63 68 65 |ed...\be|gin{sche|
|00000930| 6d 65 7d 0a 27 22 61 62 | 63 22 20 20 20 20 20 5c |me}.'"ab|c" \|
|00000940| 65 76 20 20 22 61 62 63 | 22 0a 22 61 62 63 22 20 |ev "abc|"."abc" |
|00000950| 20 20 20 20 20 5c 65 76 | 20 20 22 61 62 63 22 0a | \ev| "abc".|
|00000960| 27 31 34 35 39 33 32 20 | 20 20 20 5c 65 76 20 20 |'145932 | \ev |
|00000970| 31 34 35 39 33 32 0a 31 | 34 35 39 33 32 20 20 20 |145932.1|45932 |
|00000980| 20 20 5c 65 76 20 20 31 | 34 35 39 33 32 0a 27 5c | \ev 1|45932.'\|
|00000990| 73 63 68 74 72 75 65 20 | 20 5c 65 76 20 20 5c 73 |schtrue | \ev \s|
|000009a0| 63 68 74 72 75 65 0a 5c | 73 63 68 74 72 75 65 20 |chtrue.\|schtrue |
|000009b0| 20 20 5c 65 76 20 20 5c | 73 63 68 74 72 75 65 25 | \ev \|schtrue%|
|000009c0| 0a 5c 65 6e 64 7b 73 63 | 68 65 6d 65 7d 0a 0a 41 |.\end{sc|heme}..A|
|000009d0| 73 20 6e 6f 74 65 64 20 | 69 6e 20 73 65 63 74 69 |s noted |in secti|
|000009e0| 6f 6e 7e 5c 72 65 66 7b | 73 74 6f 72 61 67 65 6d |on~\ref{|storagem|
|000009f0| 6f 64 65 6c 7d 2c 20 69 | 74 20 69 73 20 61 6e 20 |odel}, i|t is an |
|00000a00| 65 72 72 6f 72 20 74 6f | 20 61 6c 74 65 72 20 61 |error to| alter a|
|00000a10| 20 63 6f 6e 73 74 61 6e | 74 0a 28 69 2e 65 2e 7e | constan|t.(i.e.~|
|00000a20| 74 68 65 20 76 61 6c 75 | 65 20 6f 66 20 61 20 6c |the valu|e of a l|
|00000a30| 69 74 65 72 61 6c 20 65 | 78 70 72 65 73 73 69 6f |iteral e|xpressio|
|00000a40| 6e 29 20 75 73 69 6e 67 | 20 61 20 6d 75 74 61 74 |n) using| a mutat|
|00000a50| 69 6f 6e 20 70 72 6f 63 | 65 64 75 72 65 20 6c 69 |ion proc|edure li|
|00000a60| 6b 65 0a 5c 69 64 65 7b | 73 65 74 2d 63 61 72 21 |ke.\ide{|set-car!|
|00000a70| 7d 5c 20 6f 72 20 5c 69 | 64 65 7b 73 74 72 69 6e |}\ or \i|de{strin|
|00000a80| 67 2d 73 65 74 21 7d 2e | 0a 0a 5c 65 6e 64 7b 65 |g-set!}.|..\end{e|
|00000a90| 6e 74 72 79 7d 0a 0a 0a | 5c 73 75 62 73 65 63 74 |ntry}...|\subsect|
|00000aa0| 69 6f 6e 7b 50 72 6f 63 | 65 64 75 72 65 20 63 61 |ion{Proc|edure ca|
|00000ab0| 6c 6c 73 7d 5c 75 6e 73 | 65 63 74 69 6f 6e 0a 0a |lls}\uns|ection..|
|00000ac0| 5c 62 65 67 69 6e 7b 65 | 6e 74 72 79 7d 7b 25 0a |\begin{e|ntry}{%.|
|00000ad0| 5c 70 70 72 6f 74 6f 7b | 28 5c 68 79 70 65 72 7b |\pproto{|(\hyper{|
|00000ae0| 6f 70 65 72 61 74 6f 72 | 7d 20 5c 68 79 70 65 72 |operator|} \hyper|
|00000af0| 69 7b 6f 70 65 72 61 6e | 64 7d 20 5c 64 6f 74 73 |i{operan|d} \dots|
|00000b00| 66 6f 6f 29 7d 7b 65 73 | 73 65 6e 74 69 61 6c 20 |foo)}{es|sential |
|00000b10| 5c 65 78 70 72 74 79 70 | 65 7d 7d 0a 0a 41 20 70 |\exprtyp|e}}..A p|
|00000b20| 72 6f 63 65 64 75 72 65 | 20 63 61 6c 6c 20 69 73 |rocedure| call is|
|00000b30| 20 77 72 69 74 74 65 6e | 20 62 79 20 73 69 6d 70 | written| by simp|
|00000b40| 6c 79 20 65 6e 63 6c 6f | 73 69 6e 67 20 69 6e 20 |ly enclo|sing in |
|00000b50| 70 61 72 65 6e 74 68 65 | 73 65 73 0a 65 78 70 72 |parenthe|ses.expr|
|00000b60| 65 73 73 69 6f 6e 73 20 | 66 6f 72 20 74 68 65 20 |essions |for the |
|00000b70| 70 72 6f 63 65 64 75 72 | 65 20 74 6f 20 62 65 20 |procedur|e to be |
|00000b80| 63 61 6c 6c 65 64 20 61 | 6e 64 20 74 68 65 20 61 |called a|nd the a|
|00000b90| 72 67 75 6d 65 6e 74 73 | 20 74 6f 20 62 65 0a 70 |rguments| to be.p|
|00000ba0| 61 73 73 65 64 20 74 6f | 20 69 74 2e 20 20 54 68 |assed to| it. Th|
|00000bb0| 65 20 6f 70 65 72 61 74 | 6f 72 20 61 6e 64 20 6f |e operat|or and o|
|00000bc0| 70 65 72 61 6e 64 20 65 | 78 70 72 65 73 73 69 6f |perand e|xpressio|
|00000bd0| 6e 73 20 61 72 65 20 65 | 76 61 6c 75 61 74 65 64 |ns are e|valuated|
|00000be0| 20 28 69 6e 20 61 6e 0a | 69 6e 64 65 74 65 72 6d | (in an.|indeterm|
|00000bf0| 69 6e 61 74 65 20 6f 72 | 64 65 72 29 20 61 6e 64 |inate or|der) and|
|00000c00| 20 74 68 65 20 72 65 73 | 75 6c 74 69 6e 67 20 70 | the res|ulting p|
|00000c10| 72 6f 63 65 64 75 72 65 | 20 69 73 20 70 61 73 73 |rocedure| is pass|
|00000c20| 65 64 20 74 68 65 20 72 | 65 73 75 6c 74 69 6e 67 |ed the r|esulting|
|00000c30| 0a 61 72 67 75 6d 65 6e | 74 73 2e 5c 6d 61 69 6e |.argumen|ts.\main|
|00000c40| 69 6e 64 65 78 7b 63 61 | 6c 6c 7d 5c 6d 61 69 6e |index{ca|ll}\main|
|00000c50| 69 6e 64 65 78 7b 70 72 | 6f 63 65 64 75 72 65 20 |index{pr|ocedure |
|00000c60| 63 61 6c 6c 7d 0a 5c 62 | 65 67 69 6e 7b 73 63 68 |call}.\b|egin{sch|
|00000c70| 65 6d 65 7d 25 0a 28 2b | 20 33 20 34 29 20 20 20 |eme}%.(+| 3 4) |
|00000c80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000c90| 20 20 20 20 20 20 20 5c | 65 76 20 20 37 0a 28 28 | \|ev 7.((|
|00000ca0| 69 66 20 5c 73 63 68 66 | 61 6c 73 65 20 2b 20 2a |if \schf|alse + *|
|00000cb0| 29 20 33 20 34 29 20 20 | 20 20 20 20 20 20 20 5c |) 3 4) | \|
|00000cc0| 65 76 20 20 31 32 25 0a | 5c 65 6e 64 7b 73 63 68 |ev 12%.|\end{sch|
|00000cd0| 65 6d 65 7d 0a 0a 41 20 | 6e 75 6d 62 65 72 20 6f |eme}..A |number o|
|00000ce0| 66 20 70 72 6f 63 65 64 | 75 72 65 73 20 61 72 65 |f proced|ures are|
|00000cf0| 20 61 76 61 69 6c 61 62 | 6c 65 20 61 73 20 74 68 | availab|le as th|
|00000d00| 65 20 76 61 6c 75 65 73 | 20 6f 66 20 76 61 72 69 |e values| of vari|
|00000d10| 61 62 6c 65 73 20 69 6e | 20 74 68 65 0a 69 6e 69 |ables in| the.ini|
|00000d20| 74 69 61 6c 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |tial env|ironment|
|00000d30| 3b 20 66 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 74 |; for ex|ample, t|
|00000d40| 68 65 20 61 64 64 69 74 | 69 6f 6e 20 61 6e 64 20 |he addit|ion and |
|00000d50| 6d 75 6c 74 69 70 6c 69 | 63 61 74 69 6f 6e 0a 70 |multipli|cation.p|
|00000d60| 72 6f 63 65 64 75 72 65 | 73 20 69 6e 20 74 68 65 |rocedure|s in the|
|00000d70| 20 61 62 6f 76 65 20 65 | 78 61 6d 70 6c 65 73 20 | above e|xamples |
|00000d80| 61 72 65 20 74 68 65 20 | 76 61 6c 75 65 73 20 6f |are the |values o|
|00000d90| 66 20 74 68 65 20 76 61 | 72 69 61 62 6c 65 73 20 |f the va|riables |
|00000da0| 5c 69 64 65 7b 2b 7d 0a | 61 6e 64 20 5c 69 64 65 |\ide{+}.|and \ide|
|00000db0| 7b 2a 7d 2e 20 20 4e 65 | 77 20 70 72 6f 63 65 64 |{*}. Ne|w proced|
|00000dc0| 75 72 65 73 20 61 72 65 | 20 63 72 65 61 74 65 64 |ures are| created|
|00000dd0| 20 62 79 20 65 76 61 6c | 75 61 74 69 6e 67 20 5c | by eval|uating \|
|00000de0| 6c 61 6d 62 64 61 65 78 | 70 7b 7d 73 0a 28 73 65 |lambdaex|p{}s.(se|
|00000df0| 65 20 73 65 63 74 69 6f | 6e 7e 5c 72 65 66 7b 6c |e sectio|n~\ref{l|
|00000e00| 61 6d 62 64 61 7d 29 2e | 0a 5c 74 6f 64 6f 7b 41 |ambda}).|.\todo{A|
|00000e10| 74 20 46 72 69 65 64 6d | 61 6e 27 73 20 72 65 75 |t Friedm|an's reu|
|00000e20| 65 73 74 2c 20 66 6c 75 | 73 68 65 64 20 6d 65 6e |est, flu|shed men|
|00000e30| 74 69 6f 6e 20 6f 66 20 | 6f 74 68 65 72 20 77 61 |tion of |other wa|
|00000e40| 79 73 2e 7d 0a 25 20 6f | 72 20 64 65 66 69 6e 69 |ys.}.% o|r defini|
|00000e50| 74 69 6f 6e 73 20 28 73 | 65 65 20 73 65 63 74 69 |tions (s|ee secti|
|00000e60| 6f 6e 7e 5c 72 65 66 7b | 64 65 66 69 6e 65 7d 29 |on~\ref{|define})|
|00000e70| 2e 0a 0a 50 72 6f 63 65 | 64 75 72 65 20 63 61 6c |...Proce|dure cal|
|00000e80| 6c 73 20 61 72 65 20 61 | 6c 73 6f 20 63 61 6c 6c |ls are a|lso call|
|00000e90| 65 64 20 7b 5c 65 6d 20 | 63 6f 6d 62 69 6e 61 74 |ed {\em |combinat|
|00000ea0| 69 6f 6e 73 7d 2e 0a 5c | 6d 61 69 6e 69 6e 64 65 |ions}..\|maininde|
|00000eb0| 78 7b 63 6f 6d 62 69 6e | 61 74 69 6f 6e 7d 0a 0a |x{combin|ation}..|
|00000ec0| 5c 62 65 67 69 6e 7b 6e | 6f 74 65 7d 20 49 6e 20 |\begin{n|ote} In |
|00000ed0| 63 6f 6e 74 72 61 73 74 | 20 74 6f 20 6f 74 68 65 |contrast| to othe|
|00000ee0| 72 20 64 69 61 6c 65 63 | 74 73 20 6f 66 20 4c 69 |r dialec|ts of Li|
|00000ef0| 73 70 2c 20 74 68 65 20 | 6f 72 64 65 72 20 6f 66 |sp, the |order of|
|00000f00| 0a 65 76 61 6c 75 61 74 | 69 6f 6e 20 69 73 20 75 |.evaluat|ion is u|
|00000f10| 6e 73 70 65 63 69 66 69 | 65 64 2c 20 61 6e 64 20 |nspecifi|ed, and |
|00000f20| 74 68 65 20 6f 70 65 72 | 61 74 6f 72 20 65 78 70 |the oper|ator exp|
|00000f30| 72 65 73 73 69 6f 6e 20 | 61 6e 64 20 74 68 65 20 |ression |and the |
|00000f40| 6f 70 65 72 61 6e 64 0a | 65 78 70 72 65 73 73 69 |operand.|expressi|
|00000f50| 6f 6e 73 20 61 72 65 20 | 61 6c 77 61 79 73 20 65 |ons are |always e|
|00000f60| 76 61 6c 75 61 74 65 64 | 20 77 69 74 68 20 74 68 |valuated| with th|
|00000f70| 65 20 73 61 6d 65 20 65 | 76 61 6c 75 61 74 69 6f |e same e|valuatio|
|00000f80| 6e 20 72 75 6c 65 73 2e | 0a 5c 74 6f 64 6f 7b 43 |n rules.|.\todo{C|
|00000f90| 6c 69 6e 67 65 72 3a 20 | 6d 61 79 62 65 20 73 61 |linger: |maybe sa|
|00000fa0| 79 20 60 60 54 68 69 73 | 20 69 73 20 61 20 6d 61 |y ``This| is a ma|
|00000fb0| 6a 6f 72 20 73 6f 75 72 | 63 65 20 6f 66 20 73 69 |jor sour|ce of si|
|00000fc0| 6d 70 6c 69 63 69 74 79 | 2e 27 27 7d 0a 5c 65 6e |mplicity|.''}.\en|
|00000fd0| 64 7b 6e 6f 74 65 7d 0a | 0a 5c 62 65 67 69 6e 7b |d{note}.|.\begin{|
|00000fe0| 6e 6f 74 65 7d 20 49 6e | 20 6d 61 6e 79 20 64 69 |note} In| many di|
|00000ff0| 61 6c 65 63 74 73 20 6f | 66 20 4c 69 73 70 2c 20 |alects o|f Lisp, |
|00001000| 74 68 65 20 65 6d 70 74 | 79 20 63 6f 6d 62 69 6e |the empt|y combin|
|00001010| 61 74 69 6f 6e 2c 20 7b | 5c 74 74 0a 28 29 7d 2c |ation, {|\tt.()},|
|00001020| 20 69 73 20 61 20 6c 65 | 67 69 74 69 6d 61 74 65 | is a le|gitimate|
|00001030| 20 65 78 70 72 65 73 73 | 69 6f 6e 2e 20 20 49 6e | express|ion. In|
|00001040| 20 53 63 68 65 6d 65 2c | 20 63 6f 6d 62 69 6e 61 | Scheme,| combina|
|00001050| 74 69 6f 6e 73 20 6d 75 | 73 74 20 68 61 76 65 20 |tions mu|st have |
|00001060| 61 74 0a 6c 65 61 73 74 | 20 6f 6e 65 20 73 75 62 |at.least| one sub|
|00001070| 65 78 70 72 65 73 73 69 | 6f 6e 2c 20 73 6f 20 7b |expressi|on, so {|
|00001080| 5c 74 74 20 28 29 7d 20 | 69 73 20 6e 6f 74 20 61 |\tt ()} |is not a|
|00001090| 20 73 79 6e 74 61 63 74 | 69 63 61 6c 6c 79 20 76 | syntact|ically v|
|000010a0| 61 6c 69 64 0a 65 78 70 | 72 65 73 73 69 6f 6e 2e |alid.exp|ression.|
|000010b0| 20 20 5c 74 6f 64 6f 7b | 44 79 62 76 69 67 3a 20 | \todo{|Dybvig: |
|000010c0| 60 60 69 74 20 73 68 6f | 75 6c 64 20 62 65 20 6f |``it sho|uld be o|
|000010d0| 62 76 69 6f 75 73 20 66 | 72 6f 6d 20 74 68 65 20 |bvious f|rom the |
|000010e0| 73 79 6e 74 61 78 2e 27 | 27 7d 0a 5c 65 6e 64 7b |syntax.'|'}.\end{|
|000010f0| 6e 6f 74 65 7d 0a 0a 5c | 74 6f 64 6f 7b 46 72 65 |note}..\|todo{Fre|
|00001100| 65 6d 61 6e 3a 0a 49 20 | 74 68 69 6e 6b 20 61 6e |eman:.I |think an|
|00001110| 20 65 78 70 6c 61 6e 61 | 74 69 6f 6e 20 61 73 20 | explana|tion as |
|00001120| 74 6f 20 77 68 79 20 65 | 76 61 6c 75 61 74 69 6f |to why e|valuatio|
|00001130| 6e 20 6f 72 64 65 72 20 | 69 73 20 6e 6f 74 20 73 |n order |is not s|
|00001140| 70 65 63 69 66 69 65 64 | 0a 73 68 6f 75 6c 64 20 |pecified|.should |
|00001150| 62 65 20 69 6e 63 6c 75 | 64 65 64 2e 20 20 49 74 |be inclu|ded. It|
|00001160| 20 73 68 6f 75 6c 64 20 | 6e 6f 74 20 69 6e 63 6c | should |not incl|
|00001170| 75 64 65 20 61 6e 79 20 | 72 65 66 65 72 65 6e 63 |ude any |referenc|
|00001180| 65 20 74 6f 20 70 61 72 | 61 6c 6c 65 6c 0a 65 76 |e to par|allel.ev|
|00001190| 61 6c 75 61 74 69 6f 6e | 2e 20 20 44 6f 65 73 20 |aluation|. Does |
|000011a0| 61 6e 79 20 65 78 69 73 | 74 69 6e 67 20 63 6f 6d |any exis|ting com|
|000011b0| 70 69 6c 65 72 20 67 65 | 6e 65 72 61 74 65 20 62 |piler ge|nerate b|
|000011c0| 65 74 74 65 72 20 63 6f | 64 65 20 62 65 63 61 75 |etter co|de becau|
|000011d0| 73 65 0a 74 68 65 20 65 | 76 61 6c 75 61 74 69 6f |se.the e|valuatio|
|000011e0| 6e 20 6f 72 64 65 72 20 | 69 73 20 75 6e 73 70 65 |n order |is unspe|
|000011f0| 63 69 66 69 65 64 3f 7d | 0a 0a 5c 65 6e 64 7b 65 |cified?}|..\end{e|
|00001200| 6e 74 72 79 7d 0a 0a 0a | 5c 73 75 62 73 65 63 74 |ntry}...|\subsect|
|00001210| 69 6f 6e 7b 5c 4c 61 6d | 62 64 61 65 78 70 7b 7d |ion{\Lam|bdaexp{}|
|00001220| 73 7d 5c 75 6e 73 65 63 | 74 69 6f 6e 0a 5c 6c 61 |s}\unsec|tion.\la|
|00001230| 62 65 6c 7b 6c 61 6d 62 | 61 7d 0a 0a 5c 62 65 67 |bel{lamb|a}..\beg|
|00001240| 69 6e 7b 65 6e 74 72 79 | 7d 7b 25 0a 5c 70 72 6f |in{entry|}{%.\pro|
|00001250| 74 6f 7b 6c 61 6d 62 64 | 61 7d 7b 20 5c 68 79 70 |to{lambd|a}{ \hyp|
|00001260| 65 72 7b 66 6f 72 6d 61 | 6c 73 7d 20 5c 68 79 70 |er{forma|ls} \hyp|
|00001270| 65 72 7b 62 6f 64 79 7d | 7d 7b 65 73 73 65 6e 74 |er{body}|}{essent|
|00001280| 69 61 6c 20 5c 65 78 70 | 72 74 79 70 65 7d 7d 0a |ial \exp|rtype}}.|
|00001290| 0a 5c 73 79 6e 74 61 78 | 0a 5c 68 79 70 65 72 7b |.\syntax|.\hyper{|
|000012a0| 46 6f 72 6d 61 6c 73 7d | 20 73 68 6f 75 6c 64 20 |Formals}| should |
|000012b0| 62 65 20 61 20 66 6f 72 | 6d 61 6c 20 61 72 67 75 |be a for|mal argu|
|000012c0| 6d 65 6e 74 73 20 6c 69 | 73 74 20 61 73 20 64 65 |ments li|st as de|
|000012d0| 73 63 72 69 62 65 64 20 | 62 65 6c 6f 77 2c 0a 61 |scribed |below,.a|
|000012e0| 6e 64 20 5c 68 79 70 65 | 72 7b 62 6f 64 79 7d 20 |nd \hype|r{body} |
|000012f0| 73 68 6f 75 6c 64 20 62 | 65 20 61 20 73 65 71 75 |should b|e a sequ|
|00001300| 65 6e 63 65 20 6f 66 20 | 6f 6e 65 20 6f 72 20 6d |ence of |one or m|
|00001310| 6f 72 65 20 65 78 70 72 | 65 73 73 69 6f 6e 73 2e |ore expr|essions.|
|00001320| 0a 0a 5c 73 65 6d 61 6e | 74 69 63 73 0a 5c 76 65 |..\seman|tics.\ve|
|00001330| 73 74 20 41 20 5c 6c 61 | 6d 62 64 61 65 78 70 7b |st A \la|mbdaexp{|
|00001340| 7d 20 65 76 61 6c 75 61 | 74 65 73 20 74 6f 20 61 |} evalua|tes to a|
|00001350| 20 70 72 6f 63 65 64 75 | 72 65 2e 20 20 54 68 65 | procedu|re. The|
|00001360| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 20 69 6e 0a | environ|ment in.|
|00001370| 65 66 66 65 63 74 20 77 | 68 65 6e 20 74 68 65 20 |effect w|hen the |
|00001380| 5c 6c 61 6d 62 64 61 65 | 78 70 7b 7d 20 77 61 73 |\lambdae|xp{} was|
|00001390| 20 65 76 61 6c 75 61 74 | 65 64 20 69 73 20 72 65 | evaluat|ed is re|
|000013a0| 6d 65 6d 62 65 72 65 64 | 20 61 73 20 70 61 72 74 |membered| as part|
|000013b0| 20 6f 66 20 74 68 65 0a | 70 72 6f 63 65 64 75 72 | of the.|procedur|
|000013c0| 65 2e 20 20 57 68 65 6e | 20 74 68 65 20 70 72 6f |e. When| the pro|
|000013d0| 63 65 64 75 72 65 20 69 | 73 20 6c 61 74 65 72 20 |cedure i|s later |
|000013e0| 63 61 6c 6c 65 64 20 77 | 69 74 68 20 73 6f 6d 65 |called w|ith some|
|000013f0| 20 61 63 74 75 61 6c 0a | 61 72 67 75 6d 65 6e 74 | actual.|argument|
|00001400| 73 2c 20 74 68 65 20 65 | 6e 76 69 72 6f 6e 6d 65 |s, the e|nvironme|
|00001410| 6e 74 20 69 6e 20 77 68 | 69 63 68 20 74 68 65 20 |nt in wh|ich the |
|00001420| 5c 6c 61 6d 62 64 61 65 | 78 70 7b 7d 20 77 61 73 |\lambdae|xp{} was|
|00001430| 20 65 76 61 6c 75 61 74 | 65 64 20 77 69 6c 6c 0a | evaluat|ed will.|
|00001440| 62 65 20 65 78 74 65 6e | 64 65 64 20 62 79 20 62 |be exten|ded by b|
|00001450| 69 6e 64 69 6e 67 20 74 | 68 65 20 76 61 72 69 61 |inding t|he varia|
|00001460| 62 6c 65 73 20 69 6e 20 | 74 68 65 20 66 6f 72 6d |bles in |the form|
|00001470| 61 6c 20 61 72 67 75 6d | 65 6e 74 20 6c 69 73 74 |al argum|ent list|
|00001480| 20 74 6f 0a 66 72 65 73 | 68 20 6c 6f 63 61 74 69 | to.fres|h locati|
|00001490| 6f 6e 73 2c 20 74 68 65 | 20 63 6f 72 72 65 73 70 |ons, the| corresp|
|000014a0| 6f 6e 64 69 6e 67 20 61 | 63 74 75 61 6c 20 61 72 |onding a|ctual ar|
|000014b0| 67 75 6d 65 6e 74 20 76 | 61 6c 75 65 73 20 77 69 |gument v|alues wi|
|000014c0| 6c 6c 20 62 65 20 73 74 | 6f 72 65 64 0a 69 6e 20 |ll be st|ored.in |
|000014d0| 74 68 6f 73 65 20 6c 6f | 63 61 74 69 6f 6e 73 2c |those lo|cations,|
|000014e0| 20 61 6e 64 20 74 68 65 | 20 65 78 70 72 65 73 73 | and the| express|
|000014f0| 69 6f 6e 73 20 69 6e 20 | 74 68 65 20 62 6f 64 79 |ions in |the body|
|00001500| 20 6f 66 20 74 68 65 20 | 5c 6c 61 6d 62 64 61 65 | of the |\lambdae|
|00001510| 78 70 7b 7d 0a 77 69 6c | 6c 20 62 65 20 65 76 61 |xp{}.wil|l be eva|
|00001520| 6c 75 61 74 65 64 20 73 | 65 71 75 65 6e 74 69 61 |luated s|equentia|
|00001530| 6c 6c 79 20 69 6e 20 74 | 68 65 20 65 78 74 65 6e |lly in t|he exten|
|00001540| 64 65 64 20 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 2e |ded envi|ronment.|
|00001550| 20 20 54 68 65 20 72 65 | 73 75 6c 74 0a 6f 66 20 | The re|sult.of |
|00001560| 74 68 65 20 6c 61 73 74 | 20 65 78 70 72 65 73 73 |the last| express|
|00001570| 69 6f 6e 20 69 6e 20 74 | 68 65 20 62 6f 64 79 20 |ion in t|he body |
|00001580| 77 69 6c 6c 20 62 65 20 | 72 65 74 75 72 6e 65 64 |will be |returned|
|00001590| 20 61 73 20 74 68 65 20 | 72 65 73 75 6c 74 20 6f | as the |result o|
|000015a0| 66 0a 74 68 65 20 70 72 | 6f 63 65 64 75 72 65 20 |f.the pr|ocedure |
|000015b0| 63 61 6c 6c 2e 0a 0a 5c | 62 65 67 69 6e 7b 73 63 |call...\|begin{sc|
|000015c0| 68 65 6d 65 7d 0a 28 6c | 61 6d 62 64 61 20 28 78 |heme}.(l|ambda (x|
|000015d0| 29 20 28 2b 20 78 20 78 | 29 29 20 20 20 20 20 20 |) (+ x x|)) |
|000015e0| 5c 65 76 20 20 7b 5c 65 | 6d 7b 7d 61 20 70 72 6f |\ev {\e|m{}a pro|
|000015f0| 63 65 64 75 72 65 7d 0a | 28 28 6c 61 6d 62 64 61 |cedure}.|((lambda|
|00001600| 20 28 78 29 20 28 2b 20 | 78 20 78 29 29 20 34 29 | (x) (+ |x x)) 4)|
|00001610| 20 20 5c 65 76 20 20 38 | 0a 0a 28 64 65 66 69 6e | \ev 8|..(defin|
|00001620| 65 20 72 65 76 65 72 73 | 65 2d 73 75 62 74 72 61 |e revers|e-subtra|
|00001630| 63 74 0a 20 20 28 6c 61 | 6d 62 64 61 20 28 78 20 |ct. (la|mbda (x |
|00001640| 79 29 20 28 2d 20 79 20 | 78 29 29 29 0a 28 72 65 |y) (- y |x))).(re|
|00001650| 76 65 72 73 65 2d 73 75 | 62 74 72 61 63 74 20 37 |verse-su|btract 7|
|00001660| 20 31 30 29 20 20 20 20 | 20 20 20 20 20 5c 65 76 | 10) | \ev|
|00001670| 20 20 33 0a 0a 28 64 65 | 66 69 6e 65 20 66 6f 6f | 3..(de|fine foo|
|00001680| 0a 20 20 28 6c 65 74 20 | 28 28 78 20 34 29 29 0a |. (let |((x 4)).|
|00001690| 20 20 20 20 28 6c 61 6d | 62 64 61 20 28 79 29 20 | (lam|bda (y) |
|000016a0| 28 2b 20 78 20 79 29 29 | 29 29 0a 28 66 6f 6f 20 |(+ x y))|)).(foo |
|000016b0| 36 29 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |6) | |
|000016c0| 20 20 20 20 20 20 20 20 | 20 20 20 5c 65 76 20 20 | | \ev |
|000016d0| 31 30 25 0a 5c 65 6e 64 | 7b 73 63 68 65 6d 65 7d |10%.\end|{scheme}|
|000016e0| 0a 0a 5c 68 79 70 65 72 | 7b 46 6f 72 6d 61 6c 73 |..\hyper|{Formals|
|000016f0| 7d 20 73 68 6f 75 6c 64 | 20 68 61 76 65 20 6f 6e |} should| have on|
|00001700| 65 20 6f 66 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |e of the| followi|
|00001710| 6e 67 20 66 6f 72 6d 73 | 3a 0a 0a 5c 62 65 67 69 |ng forms|:..\begi|
|00001720| 6e 7b 69 74 65 6d 69 7a | 65 7d 0a 5c 69 74 65 6d |n{itemiz|e}.\item|
|00001730| 20 7b 5c 74 74 28 5c 68 | 79 70 65 72 69 7b 76 61 | {\tt(\h|yperi{va|
|00001740| 72 69 61 62 6c 65 7d 20 | 5c 64 6f 74 73 66 6f 6f |riable} |\dotsfoo|
|00001750| 29 7d 3a 0a 54 68 65 20 | 70 72 6f 63 65 64 75 72 |)}:.The |procedur|
|00001760| 65 20 74 61 6b 65 73 20 | 61 20 66 69 78 65 64 20 |e takes |a fixed |
|00001770| 6e 75 6d 62 65 72 20 6f | 66 20 61 72 67 75 6d 65 |number o|f argume|
|00001780| 6e 74 73 3b 20 77 68 65 | 6e 20 74 68 65 20 70 72 |nts; whe|n the pr|
|00001790| 6f 63 65 64 75 72 65 20 | 69 73 0a 63 61 6c 6c 65 |ocedure |is.calle|
|000017a0| 64 2c 20 74 68 65 20 61 | 72 67 75 6d 65 6e 74 73 |d, the a|rguments|
|000017b0| 20 77 69 6c 6c 20 62 65 | 20 73 74 6f 72 65 64 20 | will be| stored |
|000017c0| 69 6e 20 74 68 65 20 62 | 69 6e 64 69 6e 67 73 20 |in the b|indings |
|000017d0| 6f 66 20 74 68 65 0a 63 | 6f 72 72 65 73 70 6f 6e |of the.c|orrespon|
|000017e0| 64 69 6e 67 20 76 61 72 | 69 61 62 6c 65 73 2e 0a |ding var|iables..|
|000017f0| 0a 5c 69 74 65 6d 20 5c | 68 79 70 65 72 7b 76 61 |.\item \|hyper{va|
|00001800| 72 69 61 62 6c 65 7d 3a | 0a 54 68 65 20 70 72 6f |riable}:|.The pro|
|00001810| 63 65 64 75 72 65 20 74 | 61 6b 65 73 20 61 6e 79 |cedure t|akes any|
|00001820| 20 6e 75 6d 62 65 72 20 | 6f 66 20 61 72 67 75 6d | number |of argum|
|00001830| 65 6e 74 73 3b 20 77 68 | 65 6e 20 74 68 65 20 70 |ents; wh|en the p|
|00001840| 72 6f 63 65 64 75 72 65 | 20 69 73 0a 63 61 6c 6c |rocedure| is.call|
|00001850| 65 64 2c 20 74 68 65 20 | 73 65 71 75 65 6e 63 65 |ed, the |sequence|
|00001860| 20 6f 66 20 61 63 74 75 | 61 6c 20 61 72 67 75 6d | of actu|al argum|
|00001870| 65 6e 74 73 20 69 73 20 | 63 6f 6e 76 65 72 74 65 |ents is |converte|
|00001880| 64 20 69 6e 74 6f 20 61 | 20 6e 65 77 6c 79 0a 61 |d into a| newly.a|
|00001890| 6c 6c 6f 63 61 74 65 64 | 20 6c 69 73 74 2c 20 61 |llocated| list, a|
|000018a0| 6e 64 20 74 68 65 20 6c | 69 73 74 20 69 73 20 73 |nd the l|ist is s|
|000018b0| 74 6f 72 65 64 20 69 6e | 20 74 68 65 20 62 69 6e |tored in| the bin|
|000018c0| 64 69 6e 67 20 6f 66 20 | 74 68 65 0a 5c 68 79 70 |ding of |the.\hyp|
|000018d0| 65 72 7b 76 61 72 69 61 | 62 6c 65 7d 2e 0a 0a 5c |er{varia|ble}...\|
|000018e0| 69 74 65 6d 20 7b 5c 74 | 74 28 5c 68 79 70 65 72 |item {\t|t(\hyper|
|000018f0| 69 7b 76 61 72 69 61 62 | 6c 65 7d 20 5c 64 6f 74 |i{variab|le} \dot|
|00001900| 73 66 6f 6f 7b 7d 20 5c | 68 79 70 65 72 7b 76 61 |sfoo{} \|hyper{va|
|00001910| 72 69 61 62 6c 65 24 5f | 7b 6e 2d 31 7d 24 7d 20 |riable$_|{n-1}$} |
|00001920| 7b 5c 62 66 2e 7d 5c 20 | 5c 68 79 70 65 72 6e 7b |{\bf.}\ |\hypern{|
|00001930| 76 61 72 69 61 62 6c 65 | 7d 29 7d 3a 0a 49 66 20 |variable|})}:.If |
|00001940| 61 20 73 70 61 63 65 2d | 64 65 6c 69 6d 69 74 65 |a space-|delimite|
|00001950| 64 20 70 65 72 69 6f 64 | 20 70 72 65 63 65 64 65 |d period| precede|
|00001960| 73 20 74 68 65 20 6c 61 | 73 74 20 76 61 72 69 61 |s the la|st varia|
|00001970| 62 6c 65 2c 20 74 68 65 | 6e 0a 74 68 65 20 76 61 |ble, the|n.the va|
|00001980| 6c 75 65 20 73 74 6f 72 | 65 64 20 69 6e 20 74 68 |lue stor|ed in th|
|00001990| 65 20 62 69 6e 64 69 6e | 67 20 6f 66 20 74 68 65 |e bindin|g of the|
|000019a0| 20 6c 61 73 74 20 76 61 | 72 69 61 62 6c 65 20 77 | last va|riable w|
|000019b0| 69 6c 6c 20 62 65 20 61 | 0a 6e 65 77 6c 79 20 61 |ill be a|.newly a|
|000019c0| 6c 6c 6f 63 61 74 65 64 | 0a 6c 69 73 74 20 6f 66 |llocated|.list of|
|000019d0| 20 74 68 65 20 61 63 74 | 75 61 6c 20 61 72 67 75 | the act|ual argu|
|000019e0| 6d 65 6e 74 73 20 6c 65 | 66 74 20 6f 76 65 72 20 |ments le|ft over |
|000019f0| 61 66 74 65 72 20 61 6c | 6c 20 74 68 65 20 6f 74 |after al|l the ot|
|00001a00| 68 65 72 20 61 63 74 75 | 61 6c 0a 61 72 67 75 6d |her actu|al.argum|
|00001a10| 65 6e 74 73 20 68 61 76 | 65 20 62 65 65 6e 20 6d |ents hav|e been m|
|00001a20| 61 74 63 68 65 64 20 75 | 70 20 61 67 61 69 6e 73 |atched u|p agains|
|00001a30| 74 20 74 68 65 20 6f 74 | 68 65 72 20 66 6f 72 6d |t the ot|her form|
|00001a40| 61 6c 20 61 72 67 75 6d | 65 6e 74 73 2e 0a 5c 65 |al argum|ents..\e|
|00001a50| 6e 64 7b 69 74 65 6d 69 | 7a 65 7d 0a 0a 49 74 20 |nd{itemi|ze}..It |
|00001a60| 69 73 20 61 6e 20 65 72 | 72 6f 72 20 66 6f 72 20 |is an er|ror for |
|00001a70| 61 20 5c 68 79 70 65 72 | 7b 76 61 72 69 61 62 6c |a \hyper|{variabl|
|00001a80| 65 7d 20 74 6f 20 61 70 | 70 65 61 72 20 6d 6f 72 |e} to ap|pear mor|
|00001a90| 65 20 74 68 61 6e 20 6f | 6e 63 65 20 69 6e 0a 5c |e than o|nce in.\|
|00001aa0| 68 79 70 65 72 7b 66 6f | 72 6d 61 6c 73 7d 2e 0a |hyper{fo|rmals}..|
|00001ab0| 0a 5c 62 65 67 69 6e 7b | 73 63 68 65 6d 65 7d 0a |.\begin{|scheme}.|
|00001ac0| 28 28 6c 61 6d 62 64 61 | 20 78 20 78 29 20 33 20 |((lambda| x x) 3 |
|00001ad0| 34 20 35 20 36 29 20 20 | 20 20 20 20 20 20 20 20 |4 5 6) | |
|00001ae0| 5c 65 76 20 20 28 33 20 | 34 20 35 20 36 29 0a 28 |\ev (3 |4 5 6).(|
|00001af0| 28 6c 61 6d 62 64 61 20 | 28 78 20 79 20 2e 20 7a |(lambda |(x y . z|
|00001b00| 29 20 7a 29 0a 20 33 20 | 34 20 35 20 36 29 20 20 |) z). 3 |4 5 6) |
|00001b10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b20| 20 20 20 20 20 5c 65 76 | 20 20 28 35 20 36 29 25 | \ev| (5 6)%|
|00001b30| 0a 5c 65 6e 64 7b 73 63 | 68 65 6d 65 7d 0a 0a 45 |.\end{sc|heme}..E|
|00001b40| 61 63 68 20 70 72 6f 63 | 65 64 75 72 65 20 63 72 |ach proc|edure cr|
|00001b50| 65 61 74 65 64 20 61 73 | 20 74 68 65 20 72 65 73 |eated as| the res|
|00001b60| 75 6c 74 20 6f 66 20 65 | 76 61 6c 75 61 74 69 6e |ult of e|valuatin|
|00001b70| 67 20 61 20 5c 6c 61 6d | 62 64 61 65 78 70 7b 7d |g a \lam|bdaexp{}|
|00001b80| 20 69 73 20 74 61 67 67 | 65 64 0a 77 69 74 68 20 | is tagg|ed.with |
|00001b90| 61 20 73 74 6f 72 61 67 | 65 20 6c 6f 63 61 74 69 |a storag|e locati|
|00001ba0| 6f 6e 2c 20 69 6e 20 6f | 72 64 65 72 20 74 6f 20 |on, in o|rder to |
|00001bb0| 6d 61 6b 65 20 5c 69 64 | 65 7b 65 71 76 3f 7d 20 |make \id|e{eqv?} |
|00001bc0| 61 6e 64 0a 5c 69 64 65 | 7b 65 71 3f 7d 20 77 6f |and.\ide|{eq?} wo|
|00001bd0| 72 6b 20 6f 6e 20 70 72 | 6f 63 65 64 75 72 65 73 |rk on pr|ocedures|
|00001be0| 20 28 73 65 65 20 73 65 | 63 74 69 6f 6e 7e 5c 72 | (see se|ction~\r|
|00001bf0| 65 66 7b 65 71 75 69 76 | 61 6c 65 6e 63 65 73 65 |ef{equiv|alencese|
|00001c00| 63 74 69 6f 6e 7d 29 2e | 0a 0a 5c 65 6e 64 7b 65 |ction}).|..\end{e|
|00001c10| 6e 74 72 79 7d 0a 0a 0a | 5c 73 75 62 73 65 63 74 |ntry}...|\subsect|
|00001c20| 69 6f 6e 7b 43 6f 6e 64 | 69 74 69 6f 6e 61 6c 73 |ion{Cond|itionals|
|00001c30| 7d 5c 75 6e 73 65 63 74 | 69 6f 6e 0a 0a 5c 62 65 |}\unsect|ion..\be|
|00001c40| 67 69 6e 7b 65 6e 74 72 | 79 7d 7b 25 0a 5c 70 72 |gin{entr|y}{%.\pr|
|00001c50| 6f 74 6f 7b 69 66 7d 7b | 20 5c 68 79 70 65 72 7b |oto{if}{| \hyper{|
|00001c60| 74 65 73 74 7d 20 5c 68 | 79 70 65 72 7b 63 6f 6e |test} \h|yper{con|
|00001c70| 73 65 71 75 65 6e 74 7d | 20 5c 68 79 70 65 72 7b |sequent}| \hyper{|
|00001c80| 61 6c 74 65 72 6e 61 74 | 65 7d 7d 7b 65 73 73 65 |alternat|e}}{esse|
|00001c90| 6e 74 69 61 6c 20 5c 65 | 78 70 72 74 79 70 65 7d |ntial \e|xprtype}|
|00001ca0| 0a 5c 70 72 6f 74 6f 7b | 69 66 7d 7b 20 5c 68 79 |.\proto{|if}{ \hy|
|00001cb0| 70 65 72 7b 74 65 73 74 | 7d 20 5c 68 79 70 65 72 |per{test|} \hyper|
|00001cc0| 7b 63 6f 6e 73 65 71 75 | 65 6e 74 7d 7d 7b 5c 65 |{consequ|ent}}{\e|
|00001cd0| 78 70 72 74 79 70 65 7d | 7d 20 20 25 5c 2f 20 69 |xprtype}|} %\/ i|
|00001ce0| 66 20 68 79 70 65 72 20 | 3d 20 69 74 61 6c 69 63 |f hyper |= italic|
|00001cf0| 0a 0a 5c 73 79 6e 74 61 | 78 0a 5c 68 79 70 65 72 |..\synta|x.\hyper|
|00001d00| 7b 54 65 73 74 7d 2c 20 | 5c 68 79 70 65 72 7b 63 |{Test}, |\hyper{c|
|00001d10| 6f 6e 73 65 71 75 65 6e | 74 7d 2c 20 61 6e 64 20 |onsequen|t}, and |
|00001d20| 5c 68 79 70 65 72 7b 61 | 6c 74 65 72 6e 61 74 65 |\hyper{a|lternate|
|00001d30| 7d 20 6d 61 79 20 62 65 | 20 61 72 62 69 74 72 61 |} may be| arbitra|
|00001d40| 72 79 0a 65 78 70 72 65 | 73 73 69 6f 6e 73 2e 0a |ry.expre|ssions..|
|00001d50| 0a 5c 73 65 6d 61 6e 74 | 69 63 73 0a 41 6e 20 5c |.\semant|ics.An \|
|00001d60| 69 64 65 7b 69 66 7d 20 | 65 78 70 72 65 73 73 69 |ide{if} |expressi|
|00001d70| 6f 6e 20 69 73 20 65 76 | 61 6c 75 61 74 65 64 20 |on is ev|aluated |
|00001d80| 61 73 20 66 6f 6c 6c 6f | 77 73 3a 20 66 69 72 73 |as follo|ws: firs|
|00001d90| 74 2c 0a 5c 68 79 70 65 | 72 7b 74 65 73 74 7d 20 |t,.\hype|r{test} |
|00001da0| 69 73 20 65 76 61 6c 75 | 61 74 65 64 2e 20 20 49 |is evalu|ated. I|
|00001db0| 66 20 69 74 20 79 69 65 | 6c 64 73 20 61 20 74 72 |f it yie|lds a tr|
|00001dc0| 75 65 20 76 61 6c 75 65 | 5c 69 6e 64 65 78 7b 74 |ue value|\index{t|
|00001dd0| 72 75 65 7d 20 28 73 65 | 65 0a 73 65 63 74 69 6f |rue} (se|e.sectio|
|00001de0| 6e 7e 5c 72 65 66 7b 62 | 6f 6f 6c 65 61 6e 73 65 |n~\ref{b|ooleanse|
|00001df0| 63 74 69 6f 6e 7d 29 2c | 20 74 68 65 6e 20 5c 68 |ction}),| then \h|
|00001e00| 79 70 65 72 7b 63 6f 6e | 73 65 71 75 65 6e 74 7d |yper{con|sequent}|
|00001e10| 20 69 73 20 65 76 61 6c | 75 61 74 65 64 20 61 6e | is eval|uated an|
|00001e20| 64 0a 69 74 73 20 76 61 | 6c 75 65 20 69 73 20 72 |d.its va|lue is r|
|00001e30| 65 74 75 72 6e 65 64 2e | 20 20 4f 74 68 65 72 77 |eturned.| Otherw|
|00001e40| 69 73 65 20 5c 68 79 70 | 65 72 7b 61 6c 74 65 72 |ise \hyp|er{alter|
|00001e50| 6e 61 74 65 7d 20 69 73 | 20 65 76 61 6c 75 61 74 |nate} is| evaluat|
|00001e60| 65 64 20 61 6e 64 20 69 | 74 73 0a 76 61 6c 75 65 |ed and i|ts.value|
|00001e70| 20 69 73 20 72 65 74 75 | 72 6e 65 64 2e 20 20 49 | is retu|rned. I|
|00001e80| 66 20 5c 68 79 70 65 72 | 7b 74 65 73 74 7d 20 79 |f \hyper|{test} y|
|00001e90| 69 65 6c 64 73 20 61 20 | 66 61 6c 73 65 20 76 61 |ields a |false va|
|00001ea0| 6c 75 65 20 61 6e 64 20 | 6e 6f 0a 5c 68 79 70 65 |lue and |no.\hype|
|00001eb0| 72 7b 61 6c 74 65 72 6e | 61 74 65 7d 20 69 73 20 |r{altern|ate} is |
|00001ec0| 73 70 65 63 69 66 69 65 | 64 2c 20 74 68 65 6e 20 |specifie|d, then |
|00001ed0| 74 68 65 20 72 65 73 75 | 6c 74 20 6f 66 20 74 68 |the resu|lt of th|
|00001ee0| 65 20 65 78 70 72 65 73 | 73 69 6f 6e 20 69 73 0a |e expres|sion is.|
|00001ef0| 75 6e 73 70 65 63 69 66 | 69 65 64 2e 0a 0a 5c 62 |unspecif|ied...\b|
|00001f00| 65 67 69 6e 7b 73 63 68 | 65 6d 65 7d 0a 28 69 66 |egin{sch|eme}.(if|
|00001f10| 20 28 3e 20 33 20 32 29 | 20 27 79 65 73 20 27 6e | (> 3 2)| 'yes 'n|
|00001f20| 6f 29 20 20 20 20 20 20 | 20 20 20 20 20 5c 65 76 |o) | \ev|
|00001f30| 20 20 79 65 73 0a 28 69 | 66 20 28 3e 20 32 20 33 | yes.(i|f (> 2 3|
|00001f40| 29 20 27 79 65 73 20 27 | 6e 6f 29 20 20 20 20 20 |) 'yes '|no) |
|00001f50| 20 20 20 20 20 20 5c 65 | 76 20 20 6e 6f 0a 28 69 | \e|v no.(i|
|00001f60| 66 20 28 3e 20 33 20 32 | 29 0a 20 20 20 20 28 2d |f (> 3 2|). (-|
|00001f70| 20 33 20 32 29 0a 20 20 | 20 20 28 2b 20 33 20 32 | 3 2). | (+ 3 2|
|00001f80| 29 29 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |)) | |
|00001f90| 20 20 20 20 20 20 5c 65 | 76 20 20 31 25 0a 5c 65 | \e|v 1%.\e|
|00001fa0| 6e 64 7b 73 63 68 65 6d | 65 7d 0a 0a 5c 65 6e 64 |nd{schem|e}..\end|
|00001fb0| 7b 65 6e 74 72 79 7d 0a | 0a 0a 5c 73 75 62 73 65 |{entry}.|..\subse|
|00001fc0| 63 74 69 6f 6e 7b 41 73 | 73 69 67 6e 6d 65 6e 74 |ction{As|signment|
|00001fd0| 73 7d 5c 75 6e 73 65 63 | 74 69 6f 6e 0a 0a 5c 62 |s}\unsec|tion..\b|
|00001fe0| 65 67 69 6e 7b 65 6e 74 | 72 79 7d 7b 25 0a 5c 70 |egin{ent|ry}{%.\p|
|00001ff0| 72 6f 74 6f 7b 73 65 74 | 21 7d 7b 20 5c 68 79 70 |roto{set|!}{ \hyp|
|00002000| 65 72 7b 76 61 72 69 61 | 62 6c 65 7d 20 5c 68 79 |er{varia|ble} \hy|
|00002010| 70 65 72 7b 65 78 70 72 | 65 73 73 69 6f 6e 7d 7d |per{expr|ession}}|
|00002020| 7b 65 73 73 65 6e 74 69 | 61 6c 20 5c 65 78 70 72 |{essenti|al \expr|
|00002030| 74 79 70 65 7d 7d 0a 0a | 5c 68 79 70 65 72 7b 45 |type}}..|\hyper{E|
|00002040| 78 70 72 65 73 73 69 6f | 6e 7d 20 69 73 20 65 76 |xpressio|n} is ev|
|00002050| 61 6c 75 61 74 65 64 2c | 20 61 6e 64 20 74 68 65 |aluated,| and the|
|00002060| 20 72 65 73 75 6c 74 69 | 6e 67 20 76 61 6c 75 65 | resulti|ng value|
|00002070| 20 69 73 20 73 74 6f 72 | 65 64 20 69 6e 0a 74 68 | is stor|ed in.th|
|00002080| 65 20 6c 6f 63 61 74 69 | 6f 6e 20 74 6f 20 77 68 |e locati|on to wh|
|00002090| 69 63 68 20 5c 68 79 70 | 65 72 7b 76 61 72 69 61 |ich \hyp|er{varia|
|000020a0| 62 6c 65 7d 20 69 73 20 | 62 6f 75 6e 64 2e 20 20 |ble} is |bound. |
|000020b0| 5c 68 79 70 65 72 7b 56 | 61 72 69 61 62 6c 65 7d |\hyper{V|ariable}|
|000020c0| 20 6d 75 73 74 0a 62 65 | 20 62 6f 75 6e 64 20 65 | must.be| bound e|
|000020d0| 69 74 68 65 72 20 69 6e | 20 73 6f 6d 65 20 72 65 |ither in| some re|
|000020e0| 67 69 6f 6e 5c 69 6e 64 | 65 78 7b 72 65 67 69 6f |gion\ind|ex{regio|
|000020f0| 6e 7d 20 65 6e 63 6c 6f | 73 69 6e 67 20 74 68 65 |n} enclo|sing the|
|00002100| 20 5c 69 64 65 7b 73 65 | 74 21 7d 5c 20 65 78 70 | \ide{se|t!}\ exp|
|00002110| 72 65 73 73 69 6f 6e 0a | 6f 72 20 61 74 20 74 6f |ression.|or at to|
|00002120| 70 20 6c 65 76 65 6c 2e | 20 20 54 68 65 20 72 65 |p level.| The re|
|00002130| 73 75 6c 74 20 6f 66 20 | 74 68 65 20 5c 69 64 65 |sult of |the \ide|
|00002140| 7b 73 65 74 21 7d 20 65 | 78 70 72 65 73 73 69 6f |{set!} e|xpressio|
|00002150| 6e 20 69 73 0a 75 6e 73 | 70 65 63 69 66 69 65 64 |n is.uns|pecified|
|00002160| 2e 0a 0a 5c 62 65 67 69 | 6e 7b 73 63 68 65 6d 65 |...\begi|n{scheme|
|00002170| 7d 0a 28 64 65 66 69 6e | 65 20 78 20 32 29 0a 28 |}.(defin|e x 2).(|
|00002180| 2b 20 78 20 31 29 20 20 | 20 20 20 20 20 20 20 20 |+ x 1) | |
|00002190| 20 20 20 20 20 20 20 5c | 65 76 20 20 33 0a 28 73 | \|ev 3.(s|
|000021a0| 65 74 21 20 78 20 34 29 | 20 20 20 20 20 20 20 20 |et! x 4)| |
|000021b0| 20 20 20 20 20 20 5c 65 | 76 20 20 5c 75 6e 73 70 | \e|v \unsp|
|000021c0| 65 63 69 66 69 65 64 0a | 28 2b 20 78 20 31 29 20 |ecified.|(+ x 1) |
|000021d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000021e0| 5c 65 76 20 20 35 25 0a | 5c 65 6e 64 7b 73 63 68 |\ev 5%.|\end{sch|
|000021f0| 65 6d 65 7d 0a 0a 5c 65 | 6e 64 7b 65 6e 74 72 79 |eme}..\e|nd{entry|
|00002200| 7d 0a 0a 0a 5c 73 65 63 | 74 69 6f 6e 7b 44 65 72 |}...\sec|tion{Der|
|00002210| 69 76 65 64 20 65 78 70 | 72 65 73 73 69 6f 6e 20 |ived exp|ression |
|00002220| 74 79 70 65 73 7d 0a 0a | 46 6f 72 20 72 65 66 65 |types}..|For refe|
|00002230| 72 65 6e 63 65 20 70 75 | 72 70 6f 73 65 73 2c 20 |rence pu|rposes, |
|00002240| 73 65 63 74 69 6f 6e 7e | 5c 72 65 66 7b 64 65 72 |section~|\ref{der|
|00002250| 69 76 65 64 73 65 63 74 | 69 6f 6e 7d 20 67 69 76 |ivedsect|ion} giv|
|00002260| 65 73 20 72 65 77 72 69 | 74 65 20 72 75 6c 65 73 |es rewri|te rules|
|00002270| 0a 74 68 61 74 20 77 69 | 6c 6c 20 63 6f 6e 76 65 |.that wi|ll conve|
|00002280| 72 74 20 63 6f 6e 73 74 | 72 75 63 74 73 20 64 65 |rt const|ructs de|
|00002290| 73 63 72 69 62 65 64 20 | 69 6e 20 74 68 69 73 20 |scribed |in this |
|000022a0| 73 65 63 74 69 6f 6e 20 | 69 6e 74 6f 20 74 68 65 |section |into the|
|000022b0| 0a 70 72 69 6d 69 74 69 | 76 65 20 63 6f 6e 73 74 |.primiti|ve const|
|000022c0| 72 75 63 74 73 20 64 65 | 73 63 72 69 62 65 64 20 |ructs de|scribed |
|000022d0| 69 6e 20 74 68 65 20 70 | 72 65 76 69 6f 75 73 20 |in the p|revious |
|000022e0| 73 65 63 74 69 6f 6e 2e | 0a 0a 0a 5c 73 75 62 73 |section.|...\subs|
|000022f0| 65 63 74 69 6f 6e 7b 43 | 6f 6e 64 69 74 69 6f 6e |ection{C|ondition|
|00002300| 61 6c 73 7d 5c 75 6e 73 | 65 63 74 69 6f 6e 0a 0a |als}\uns|ection..|
|00002310| 5c 62 65 67 69 6e 7b 65 | 6e 74 72 79 7d 7b 25 0a |\begin{e|ntry}{%.|
|00002320| 5c 70 72 6f 74 6f 7b 63 | 6f 6e 64 7d 7b 20 5c 68 |\proto{c|ond}{ \h|
|00002330| 79 70 65 72 69 7b 63 6c | 61 75 73 65 7d 20 5c 68 |yperi{cl|ause} \h|
|00002340| 79 70 65 72 69 69 7b 63 | 6c 61 75 73 65 7d 20 5c |yperii{c|lause} \|
|00002350| 64 6f 74 73 66 6f 6f 7d | 7b 65 73 73 65 6e 74 69 |dotsfoo}|{essenti|
|00002360| 61 6c 20 5c 65 78 70 72 | 74 79 70 65 7d 7d 0a 0a |al \expr|type}}..|
|00002370| 5c 73 79 6e 74 61 78 0a | 45 61 63 68 20 5c 68 79 |\syntax.|Each \hy|
|00002380| 70 65 72 7b 63 6c 61 75 | 73 65 7d 20 73 68 6f 75 |per{clau|se} shou|
|00002390| 6c 64 20 62 65 20 6f 66 | 20 74 68 65 20 66 6f 72 |ld be of| the for|
|000023a0| 6d 0a 5c 62 65 67 69 6e | 7b 73 63 68 65 6d 65 7d |m.\begin|{scheme}|
|000023b0| 0a 28 5c 68 79 70 65 72 | 7b 74 65 73 74 7d 20 5c |.(\hyper|{test} \|
|000023c0| 68 79 70 65 72 7b 65 78 | 70 72 65 73 73 69 6f 6e |hyper{ex|pression|
|000023d0| 7d 20 5c 64 6f 74 73 66 | 6f 6f 29 25 0a 5c 65 6e |} \dotsf|oo)%.\en|
|000023e0| 64 7b 73 63 68 65 6d 65 | 7d 0a 77 68 65 72 65 20 |d{scheme|}.where |
|000023f0| 5c 68 79 70 65 72 7b 74 | 65 73 74 7d 20 69 73 20 |\hyper{t|est} is |
|00002400| 61 6e 79 20 65 78 70 72 | 65 73 73 69 6f 6e 2e 20 |any expr|ession. |
|00002410| 20 54 68 65 20 6c 61 73 | 74 20 5c 68 79 70 65 72 | The las|t \hyper|
|00002420| 7b 63 6c 61 75 73 65 7d | 20 6d 61 79 20 62 65 0a |{clause}| may be.|
|00002430| 61 6e 20 60 60 65 6c 73 | 65 20 63 6c 61 75 73 65 |an ``els|e clause|
|00002440| 2c 27 27 20 77 68 69 63 | 68 20 68 61 73 20 74 68 |,'' whic|h has th|
|00002450| 65 20 66 6f 72 6d 0a 5c | 62 65 67 69 6e 7b 73 63 |e form.\|begin{sc|
|00002460| 68 65 6d 65 7d 0a 28 65 | 6c 73 65 20 5c 68 79 70 |heme}.(e|lse \hyp|
|00002470| 65 72 69 7b 65 78 70 72 | 65 73 73 69 6f 6e 7d 20 |eri{expr|ession} |
|00002480| 5c 68 79 70 65 72 69 69 | 7b 65 78 70 72 65 73 73 |\hyperii|{express|
|00002490| 69 6f 6e 7d 20 5c 64 6f | 74 73 66 6f 6f 29 5c 72 |ion} \do|tsfoo)\r|
|000024a0| 6d 2e 25 0a 5c 65 6e 64 | 7b 73 63 68 65 6d 65 7d |m.%.\end|{scheme}|
|000024b0| 0a 5c 6d 61 69 6e 73 63 | 68 69 6e 64 65 78 7b 65 |.\mainsc|hindex{e|
|000024c0| 6c 73 65 7d 0a 5c 6d 61 | 69 6e 73 63 68 69 6e 64 |lse}.\ma|inschind|
|000024d0| 65 78 7b 3d 3e 7d 0a 0a | 5c 73 65 6d 61 6e 74 69 |ex{=>}..|\semanti|
|000024e0| 63 73 0a 41 20 5c 69 64 | 65 7b 63 6f 6e 64 7d 20 |cs.A \id|e{cond} |
|000024f0| 65 78 70 72 65 73 73 69 | 6f 6e 20 69 73 20 65 76 |expressi|on is ev|
|00002500| 61 6c 75 61 74 65 64 20 | 62 79 20 65 76 61 6c 75 |aluated |by evalu|
|00002510| 61 74 69 6e 67 20 74 68 | 65 20 5c 68 79 70 65 72 |ating th|e \hyper|
|00002520| 7b 74 65 73 74 7d 0a 65 | 78 70 72 65 73 73 69 6f |{test}.e|xpressio|
|00002530| 6e 73 20 6f 66 20 73 75 | 63 63 65 73 73 69 76 65 |ns of su|ccessive|
|00002540| 20 5c 68 79 70 65 72 7b | 63 6c 61 75 73 65 7d 73 | \hyper{|clause}s|
|00002550| 20 69 6e 20 6f 72 64 65 | 72 20 75 6e 74 69 6c 20 | in orde|r until |
|00002560| 6f 6e 65 20 6f 66 20 74 | 68 65 6d 0a 65 76 61 6c |one of t|hem.eval|
|00002570| 75 61 74 65 73 20 74 6f | 20 61 20 74 72 75 65 20 |uates to| a true |
|00002580| 76 61 6c 75 65 5c 69 6e | 64 65 78 7b 74 72 75 65 |value\in|dex{true|
|00002590| 7d 20 28 73 65 65 0a 73 | 65 63 74 69 6f 6e 7e 5c |} (see.s|ection~\|
|000025a0| 72 65 66 7b 62 6f 6f 6c | 65 61 6e 73 65 63 74 69 |ref{bool|eansecti|
|000025b0| 6f 6e 7d 29 2e 20 20 57 | 68 65 6e 20 61 20 5c 68 |on}). W|hen a \h|
|000025c0| 79 70 65 72 7b 74 65 73 | 74 7d 20 65 76 61 6c 75 |yper{tes|t} evalu|
|000025d0| 61 74 65 73 20 74 6f 20 | 61 20 74 72 75 65 0a 76 |ates to |a true.v|
|000025e0| 61 6c 75 65 2c 20 74 68 | 65 6e 20 74 68 65 20 72 |alue, th|en the r|
|000025f0| 65 6d 61 69 6e 69 6e 67 | 20 5c 68 79 70 65 72 7b |emaining| \hyper{|
|00002600| 65 78 70 72 65 73 73 69 | 6f 6e 7d 73 20 69 6e 20 |expressi|on}s in |
|00002610| 69 74 73 20 5c 68 79 70 | 65 72 7b 63 6c 61 75 73 |its \hyp|er{claus|
|00002620| 65 7d 20 61 72 65 0a 65 | 76 61 6c 75 61 74 65 64 |e} are.e|valuated|
|00002630| 20 69 6e 20 6f 72 64 65 | 72 2c 20 61 6e 64 20 74 | in orde|r, and t|
|00002640| 68 65 20 72 65 73 75 6c | 74 20 6f 66 20 74 68 65 |he resul|t of the|
|00002650| 20 6c 61 73 74 20 5c 68 | 79 70 65 72 7b 65 78 70 | last \h|yper{exp|
|00002660| 72 65 73 73 69 6f 6e 7d | 20 69 6e 20 74 68 65 0a |ression}| in the.|
|00002670| 5c 68 79 70 65 72 7b 63 | 6c 61 75 73 65 7d 20 69 |\hyper{c|lause} i|
|00002680| 73 20 72 65 74 75 72 6e | 65 64 20 61 73 20 74 68 |s return|ed as th|
|00002690| 65 20 72 65 73 75 6c 74 | 20 6f 66 20 74 68 65 20 |e result| of the |
|000026a0| 65 6e 74 69 72 65 20 5c | 69 64 65 7b 63 6f 6e 64 |entire \|ide{cond|
|000026b0| 7d 0a 65 78 70 72 65 73 | 73 69 6f 6e 2e 20 20 49 |}.expres|sion. I|
|000026c0| 66 20 74 68 65 20 73 65 | 6c 65 63 74 65 64 20 5c |f the se|lected \|
|000026d0| 68 79 70 65 72 7b 63 6c | 61 75 73 65 7d 20 63 6f |hyper{cl|ause} co|
|000026e0| 6e 74 61 69 6e 73 20 6f | 6e 6c 79 20 74 68 65 0a |ntains o|nly the.|
|000026f0| 5c 68 79 70 65 72 7b 74 | 65 73 74 7d 20 61 6e 64 |\hyper{t|est} and|
|00002700| 20 6e 6f 20 5c 68 79 70 | 65 72 7b 65 78 70 72 65 | no \hyp|er{expre|
|00002710| 73 73 69 6f 6e 7d 73 2c | 20 74 68 65 6e 20 74 68 |ssion}s,| then th|
|00002720| 65 20 76 61 6c 75 65 20 | 6f 66 20 74 68 65 0a 5c |e value |of the.\|
|00002730| 68 79 70 65 72 7b 74 65 | 73 74 7d 20 69 73 20 72 |hyper{te|st} is r|
|00002740| 65 74 75 72 6e 65 64 20 | 61 73 20 74 68 65 20 72 |eturned |as the r|
|00002750| 65 73 75 6c 74 2e 20 20 | 49 66 20 61 6c 6c 20 5c |esult. |If all \|
|00002760| 68 79 70 65 72 7b 74 65 | 73 74 7d 73 20 65 76 61 |hyper{te|st}s eva|
|00002770| 6c 75 61 74 65 0a 74 6f | 20 66 61 6c 73 65 20 76 |luate.to| false v|
|00002780| 61 6c 75 65 73 2c 20 61 | 6e 64 20 74 68 65 72 65 |alues, a|nd there|
|00002790| 20 69 73 20 6e 6f 20 65 | 6c 73 65 20 63 6c 61 75 | is no e|lse clau|
|000027a0| 73 65 2c 20 74 68 65 6e | 20 74 68 65 20 72 65 73 |se, then| the res|
|000027b0| 75 6c 74 20 6f 66 0a 74 | 68 65 20 63 6f 6e 64 69 |ult of.t|he condi|
|000027c0| 74 69 6f 6e 61 6c 20 65 | 78 70 72 65 73 73 69 6f |tional e|xpressio|
|000027d0| 6e 20 69 73 20 75 6e 73 | 70 65 63 69 66 69 65 64 |n is uns|pecified|
|000027e0| 3b 20 69 66 20 74 68 65 | 72 65 20 69 73 20 61 6e |; if the|re is an|
|000027f0| 20 65 6c 73 65 0a 63 6c | 61 75 73 65 2c 20 74 68 | else.cl|ause, th|
|00002800| 65 6e 20 69 74 73 20 5c | 68 79 70 65 72 7b 65 78 |en its \|hyper{ex|
|00002810| 70 72 65 73 73 69 6f 6e | 7d 73 20 61 72 65 20 65 |pression|}s are e|
|00002820| 76 61 6c 75 61 74 65 64 | 2c 20 61 6e 64 20 74 68 |valuated|, and th|
|00002830| 65 20 76 61 6c 75 65 20 | 6f 66 0a 74 68 65 20 6c |e value |of.the l|
|00002840| 61 73 74 20 6f 6e 65 20 | 69 73 20 72 65 74 75 72 |ast one |is retur|
|00002850| 6e 65 64 2e 0a 0a 5c 62 | 65 67 69 6e 7b 73 63 68 |ned...\b|egin{sch|
|00002860| 65 6d 65 7d 0a 28 63 6f | 6e 64 20 28 28 3e 20 33 |eme}.(co|nd ((> 3|
|00002870| 20 32 29 20 27 67 72 65 | 61 74 65 72 29 0a 20 20 | 2) 'gre|ater). |
|00002880| 20 20 20 20 28 28 3c 20 | 33 20 32 29 20 27 6c 65 | ((< |3 2) 'le|
|00002890| 73 73 29 29 20 20 20 20 | 20 20 20 20 20 5c 65 76 |ss)) | \ev|
|000028a0| 20 20 67 72 65 61 74 65 | 72 25 0a 0a 28 63 6f 6e | greate|r%..(con|
|000028b0| 64 20 28 28 3e 20 33 20 | 33 29 20 27 67 72 65 61 |d ((> 3 |3) 'grea|
|000028c0| 74 65 72 29 0a 20 20 20 | 20 20 20 28 28 3c 20 33 |ter). | ((< 3|
|000028d0| 20 33 29 20 27 6c 65 73 | 73 29 0a 20 20 20 20 20 | 3) 'les|s). |
|000028e0| 20 28 65 6c 73 65 20 27 | 65 71 75 61 6c 29 29 20 | (else '|equal)) |
|000028f0| 20 20 20 20 20 20 20 20 | 20 20 20 5c 65 76 20 20 | | \ev |
|00002900| 65 71 75 61 6c 25 0a 5c | 65 6e 64 7b 73 63 68 65 |equal%.\|end{sche|
|00002910| 6d 65 7d 0a 0a 53 6f 6d | 65 20 69 6d 70 6c 65 6d |me}..Som|e implem|
|00002920| 65 6e 74 61 74 69 6f 6e | 73 20 73 75 70 70 6f 72 |entation|s suppor|
|00002930| 74 20 61 6e 20 61 6c 74 | 65 72 6e 61 74 69 76 65 |t an alt|ernative|
|00002940| 20 5c 68 79 70 65 72 7b | 63 6c 61 75 73 65 7d 20 | \hyper{|clause} |
|00002950| 73 79 6e 74 61 78 2c 0a | 7b 5c 74 74 28 5c 68 79 |syntax,.|{\tt(\hy|
|00002960| 70 65 72 7b 74 65 73 74 | 7d 20 3d 3e 20 5c 68 79 |per{test|} => \hy|
|00002970| 70 65 72 7b 72 65 63 69 | 70 69 65 6e 74 7d 29 7d |per{reci|pient})}|
|00002980| 2c 20 77 68 65 72 65 20 | 5c 68 79 70 65 72 7b 72 |, where |\hyper{r|
|00002990| 65 63 69 70 69 65 6e 74 | 7d 20 69 73 20 61 6e 0a |ecipient|} is an.|
|000029a0| 65 78 70 72 65 73 73 69 | 6f 6e 2e 20 20 49 66 20 |expressi|on. If |
|000029b0| 5c 68 79 70 65 72 7b 74 | 65 73 74 7d 20 65 76 61 |\hyper{t|est} eva|
|000029c0| 6c 75 61 74 65 73 20 74 | 6f 20 61 20 74 72 75 65 |luates t|o a true|
|000029d0| 20 76 61 6c 75 65 2c 20 | 74 68 65 6e 0a 5c 68 79 | value, |then.\hy|
|000029e0| 70 65 72 7b 72 65 63 69 | 70 69 65 6e 74 7d 20 69 |per{reci|pient} i|
|000029f0| 73 20 65 76 61 6c 75 61 | 74 65 64 2e 20 20 49 74 |s evalua|ted. It|
|00002a00| 73 20 76 61 6c 75 65 20 | 6d 75 73 74 20 62 65 20 |s value |must be |
|00002a10| 61 20 70 72 6f 63 65 64 | 75 72 65 20 6f 66 20 6f |a proced|ure of o|
|00002a20| 6e 65 0a 61 72 67 75 6d | 65 6e 74 3b 20 74 68 69 |ne.argum|ent; thi|
|00002a30| 73 20 70 72 6f 63 65 64 | 75 72 65 20 69 73 20 74 |s proced|ure is t|
|00002a40| 68 65 6e 20 69 6e 76 6f | 6b 65 64 20 6f 6e 20 74 |hen invo|ked on t|
|00002a50| 68 65 20 76 61 6c 75 65 | 20 6f 66 20 74 68 65 0a |he value| of the.|
|00002a60| 5c 68 79 70 65 72 7b 74 | 65 73 74 7d 2e 0a 0a 5c |\hyper{t|est}...\|
|00002a70| 62 65 67 69 6e 7b 73 63 | 68 65 6d 65 7d 0a 28 63 |begin{sc|heme}.(c|
|00002a80| 6f 6e 64 20 28 28 61 73 | 73 76 20 27 62 20 27 28 |ond ((as|sv 'b '(|
|00002a90| 28 61 20 31 29 20 28 62 | 20 32 29 29 29 20 3d 3e |(a 1) (b| 2))) =>|
|00002aa0| 20 63 61 64 72 29 0a 20 | 20 20 20 20 20 28 65 6c | cadr). | (el|
|00002ab0| 73 65 20 5c 73 63 68 66 | 61 6c 73 65 7b 7d 29 29 |se \schf|alse{}))|
|00002ac0| 20 20 20 20 20 20 20 20 | 20 5c 65 76 20 20 32 25 | | \ev 2%|
|00002ad0| 0a 5c 65 6e 64 7b 73 63 | 68 65 6d 65 7d 0a 0a 0a |.\end{sc|heme}...|
|00002ae0| 5c 65 6e 64 7b 65 6e 74 | 72 79 7d 0a 0a 0a 5c 62 |\end{ent|ry}...\b|
|00002af0| 65 67 69 6e 7b 65 6e 74 | 72 79 7d 7b 25 0a 5c 70 |egin{ent|ry}{%.\p|
|00002b00| 72 6f 74 6f 7b 63 61 73 | 65 7d 7b 20 5c 68 79 70 |roto{cas|e}{ \hyp|
|00002b10| 65 72 7b 6b 65 79 7d 20 | 5c 68 79 70 65 72 69 7b |er{key} |\hyperi{|
|00002b20| 63 6c 61 75 73 65 7d 20 | 5c 68 79 70 65 72 69 69 |clause} |\hyperii|
|00002b30| 7b 63 6c 61 75 73 65 7d | 20 5c 64 6f 74 73 66 6f |{clause}| \dotsfo|
|00002b40| 6f 7d 7b 65 73 73 65 6e | 74 69 61 6c 20 5c 65 78 |o}{essen|tial \ex|
|00002b50| 70 72 74 79 70 65 7d 7d | 0a 0a 5c 73 79 6e 74 61 |prtype}}|..\synta|
|00002b60| 78 0a 5c 68 79 70 65 72 | 7b 4b 65 79 7d 20 6d 61 |x.\hyper|{Key} ma|
|00002b70| 79 20 62 65 20 61 6e 79 | 20 65 78 70 72 65 73 73 |y be any| express|
|00002b80| 69 6f 6e 2e 20 20 45 61 | 63 68 20 5c 68 79 70 65 |ion. Ea|ch \hype|
|00002b90| 72 7b 63 6c 61 75 73 65 | 7d 20 73 68 6f 75 6c 64 |r{clause|} should|
|00002ba0| 20 68 61 76 65 0a 74 68 | 65 20 66 6f 72 6d 0a 5c | have.th|e form.\|
|00002bb0| 62 65 67 69 6e 7b 73 63 | 68 65 6d 65 7d 0a 28 28 |begin{sc|heme}.((|
|00002bc0| 5c 68 79 70 65 72 69 7b | 64 61 74 75 6d 7d 20 5c |\hyperi{|datum} \|
|00002bd0| 64 6f 74 73 66 6f 6f 29 | 20 5c 68 79 70 65 72 69 |dotsfoo)| \hyperi|
|00002be0| 7b 65 78 70 72 65 73 73 | 69 6f 6e 7d 20 5c 68 79 |{express|ion} \hy|
|00002bf0| 70 65 72 69 69 7b 65 78 | 70 72 65 73 73 69 6f 6e |perii{ex|pression|
|00002c00| 7d 20 5c 64 6f 74 73 66 | 6f 6f 29 5c 72 6d 2c 25 |} \dotsf|oo)\rm,%|
|00002c10| 0a 5c 65 6e 64 7b 73 63 | 68 65 6d 65 7d 0a 77 68 |.\end{sc|heme}.wh|
|00002c20| 65 72 65 20 65 61 63 68 | 20 5c 68 79 70 65 72 7b |ere each| \hyper{|
|00002c30| 64 61 74 75 6d 7d 20 69 | 73 20 61 6e 20 65 78 74 |datum} i|s an ext|
|00002c40| 65 72 6e 61 6c 20 72 65 | 70 72 65 73 65 6e 74 61 |ernal re|presenta|
|00002c50| 74 69 6f 6e 20 6f 66 20 | 73 6f 6d 65 20 6f 62 6a |tion of |some obj|
|00002c60| 65 63 74 2e 0a 41 6c 6c | 20 74 68 65 20 5c 68 79 |ect..All| the \hy|
|00002c70| 70 65 72 7b 64 61 74 75 | 6d 7d 73 20 6d 75 73 74 |per{datu|m}s must|
|00002c80| 20 62 65 20 64 69 73 74 | 69 6e 63 74 2e 0a 54 68 | be dist|inct..Th|
|00002c90| 65 20 6c 61 73 74 20 5c | 68 79 70 65 72 7b 63 6c |e last \|hyper{cl|
|00002ca0| 61 75 73 65 7d 20 6d 61 | 79 20 62 65 20 61 6e 20 |ause} ma|y be an |
|00002cb0| 60 60 65 6c 73 65 20 63 | 6c 61 75 73 65 2c 27 27 |``else c|lause,''|
|00002cc0| 20 77 68 69 63 68 20 68 | 61 73 20 74 68 65 20 66 | which h|as the f|
|00002cd0| 6f 72 6d 0a 5c 62 65 67 | 69 6e 7b 73 63 68 65 6d |orm.\beg|in{schem|
|00002ce0| 65 7d 0a 28 65 6c 73 65 | 20 5c 68 79 70 65 72 69 |e}.(else| \hyperi|
|00002cf0| 7b 65 78 70 72 65 73 73 | 69 6f 6e 7d 20 5c 68 79 |{express|ion} \hy|
|00002d00| 70 65 72 69 69 7b 65 78 | 70 72 65 73 73 69 6f 6e |perii{ex|pression|
|00002d10| 7d 20 5c 64 6f 74 73 66 | 6f 6f 29 5c 72 6d 2e 25 |} \dotsf|oo)\rm.%|
|00002d20| 0a 5c 65 6e 64 7b 73 63 | 68 65 6d 65 7d 0a 5c 73 |.\end{sc|heme}.\s|
|00002d30| 63 68 69 6e 64 65 78 7b | 65 6c 73 65 7d 0a 0a 5c |chindex{|else}..\|
|00002d40| 73 65 6d 61 6e 74 69 63 | 73 0a 41 20 5c 69 64 65 |semantic|s.A \ide|
|00002d50| 7b 63 61 73 65 7d 20 65 | 78 70 72 65 73 73 69 6f |{case} e|xpressio|
|00002d60| 6e 20 69 73 20 65 76 61 | 6c 75 61 74 65 64 20 61 |n is eva|luated a|
|00002d70| 73 20 66 6f 6c 6c 6f 77 | 73 2e 20 20 5c 68 79 70 |s follow|s. \hyp|
|00002d80| 65 72 7b 4b 65 79 7d 20 | 69 73 0a 65 76 61 6c 75 |er{Key} |is.evalu|
|00002d90| 61 74 65 64 20 61 6e 64 | 20 69 74 73 20 72 65 73 |ated and| its res|
|00002da0| 75 6c 74 20 69 73 20 63 | 6f 6d 70 61 72 65 64 20 |ult is c|ompared |
|00002db0| 61 67 61 69 6e 73 74 20 | 65 61 63 68 20 5c 68 79 |against |each \hy|
|00002dc0| 70 65 72 7b 64 61 74 75 | 6d 7d 2e 20 20 49 66 20 |per{datu|m}. If |
|00002dd0| 74 68 65 0a 72 65 73 75 | 6c 74 20 6f 66 20 65 76 |the.resu|lt of ev|
|00002de0| 61 6c 75 61 74 69 6e 67 | 20 5c 68 79 70 65 72 7b |aluating| \hyper{|
|00002df0| 6b 65 79 7d 20 69 73 20 | 65 71 75 69 76 61 6c 65 |key} is |equivale|
|00002e00| 6e 74 20 28 69 6e 20 74 | 68 65 20 73 65 6e 73 65 |nt (in t|he sense|
|00002e10| 20 6f 66 0a 5c 69 64 65 | 7b 65 71 76 3f 7d 3b 20 | of.\ide|{eqv?}; |
|00002e20| 73 65 65 20 73 65 63 74 | 69 6f 6e 7e 5c 72 65 66 |see sect|ion~\ref|
|00002e30| 7b 65 71 76 3f 7d 29 20 | 74 6f 20 61 20 5c 68 79 |{eqv?}) |to a \hy|
|00002e40| 70 65 72 7b 64 61 74 75 | 6d 7d 2c 20 74 68 65 6e |per{datu|m}, then|
|00002e50| 20 74 68 65 0a 65 78 70 | 72 65 73 73 69 6f 6e 73 | the.exp|ressions|
|00002e60| 20 69 6e 20 74 68 65 20 | 63 6f 72 72 65 73 70 6f | in the |correspo|
|00002e70| 6e 64 69 6e 67 20 5c 68 | 79 70 65 72 7b 63 6c 61 |nding \h|yper{cla|
|00002e80| 75 73 65 7d 20 61 72 65 | 20 65 76 61 6c 75 61 74 |use} are| evaluat|
|00002e90| 65 64 20 66 72 6f 6d 20 | 6c 65 66 74 0a 74 6f 20 |ed from |left.to |
|00002ea0| 72 69 67 68 74 20 61 6e | 64 20 74 68 65 20 72 65 |right an|d the re|
|00002eb0| 73 75 6c 74 20 6f 66 20 | 74 68 65 20 6c 61 73 74 |sult of |the last|
|00002ec0| 20 65 78 70 72 65 73 73 | 69 6f 6e 20 69 6e 20 74 | express|ion in t|
|00002ed0| 68 65 20 5c 68 79 70 65 | 72 7b 63 6c 61 75 73 65 |he \hype|r{clause|
|00002ee0| 7d 20 69 73 0a 72 65 74 | 75 72 6e 65 64 20 61 73 |} is.ret|urned as|
|00002ef0| 20 74 68 65 20 72 65 73 | 75 6c 74 20 6f 66 20 74 | the res|ult of t|
|00002f00| 68 65 20 5c 69 64 65 7b | 63 61 73 65 7d 20 65 78 |he \ide{|case} ex|
|00002f10| 70 72 65 73 73 69 6f 6e | 2e 20 20 49 66 20 74 68 |pression|. If th|
|00002f20| 65 20 72 65 73 75 6c 74 | 20 6f 66 0a 65 76 61 6c |e result| of.eval|
|00002f30| 75 61 74 69 6e 67 20 5c | 68 79 70 65 72 7b 6b 65 |uating \|hyper{ke|
|00002f40| 79 7d 20 69 73 20 64 69 | 66 66 65 72 65 6e 74 20 |y} is di|fferent |
|00002f50| 66 72 6f 6d 20 65 76 65 | 72 79 20 5c 68 79 70 65 |from eve|ry \hype|
|00002f60| 72 7b 64 61 74 75 6d 7d | 2c 20 74 68 65 6e 20 69 |r{datum}|, then i|
|00002f70| 66 0a 74 68 65 72 65 20 | 69 73 20 61 6e 20 65 6c |f.there |is an el|
|00002f80| 73 65 20 63 6c 61 75 73 | 65 20 69 74 73 20 65 78 |se claus|e its ex|
|00002f90| 70 72 65 73 73 69 6f 6e | 73 20 61 72 65 20 65 76 |pression|s are ev|
|00002fa0| 61 6c 75 61 74 65 64 20 | 61 6e 64 20 74 68 65 0a |aluated |and the.|
|00002fb0| 72 65 73 75 6c 74 20 6f | 66 20 74 68 65 20 6c 61 |result o|f the la|
|00002fc0| 73 74 20 69 73 20 74 68 | 65 20 72 65 73 75 6c 74 |st is th|e result|
|00002fd0| 20 6f 66 20 74 68 65 20 | 5c 69 64 65 7b 63 61 73 | of the |\ide{cas|
|00002fe0| 65 7d 20 65 78 70 72 65 | 73 73 69 6f 6e 3b 20 6f |e} expre|ssion; o|
|00002ff0| 74 68 65 72 77 69 73 65 | 0a 74 68 65 20 72 65 73 |therwise|.the res|
|00003000| 75 6c 74 20 6f 66 20 74 | 68 65 20 5c 69 64 65 7b |ult of t|he \ide{|
|00003010| 63 61 73 65 7d 20 65 78 | 70 72 65 73 73 69 6f 6e |case} ex|pression|
|00003020| 20 69 73 20 75 6e 73 70 | 65 63 69 66 69 65 64 2e | is unsp|ecified.|
|00003030| 0a 0a 5c 62 65 67 69 6e | 7b 73 63 68 65 6d 65 7d |..\begin|{scheme}|
|00003040| 0a 28 63 61 73 65 20 28 | 2a 20 32 20 33 29 0a 20 |.(case (|* 2 3). |
|00003050| 20 28 28 32 20 33 20 35 | 20 37 29 20 27 70 72 69 | ((2 3 5| 7) 'pri|
|00003060| 6d 65 29 0a 20 20 28 28 | 31 20 34 20 36 20 38 20 |me). ((|1 4 6 8 |
|00003070| 39 29 20 27 63 6f 6d 70 | 6f 73 69 74 65 29 29 20 |9) 'comp|osite)) |
|00003080| 20 20 20 20 5c 65 76 20 | 20 63 6f 6d 70 6f 73 69 | \ev | composi|
|00003090| 74 65 0a 28 63 61 73 65 | 20 28 63 61 72 20 27 28 |te.(case| (car '(|
|000030a0| 63 20 64 29 29 0a 20 20 | 28 28 61 29 20 27 61 29 |c d)). |((a) 'a)|
|000030b0| 0a 20 20 28 28 62 29 20 | 27 62 29 29 20 20 20 20 |. ((b) |'b)) |
|000030c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000030d0| 20 5c 65 76 20 20 5c 75 | 6e 73 70 65 63 69 66 69 | \ev \u|nspecifi|
|000030e0| 65 64 0a 28 63 61 73 65 | 20 28 63 61 72 20 27 28 |ed.(case| (car '(|
|000030f0| 63 20 64 29 29 0a 20 20 | 28 28 61 20 65 20 69 20 |c d)). |((a e i |
|00003100| 6f 20 75 29 20 27 76 6f | 77 65 6c 29 0a 20 20 28 |o u) 'vo|wel). (|
|00003110| 28 77 20 79 29 20 27 73 | 65 6d 69 76 6f 77 65 6c |(w y) 's|emivowel|
|00003120| 29 0a 20 20 28 65 6c 73 | 65 20 27 63 6f 6e 73 6f |). (els|e 'conso|
|00003130| 6e 61 6e 74 29 29 20 20 | 20 20 20 20 20 20 20 20 |nant)) | |
|00003140| 20 20 5c 65 76 20 20 63 | 6f 6e 73 6f 6e 61 6e 74 | \ev c|onsonant|
|00003150| 25 0a 5c 65 6e 64 7b 73 | 63 68 65 6d 65 7d 0a 0a |%.\end{s|cheme}..|
|00003160| 5c 65 6e 64 7b 65 6e 74 | 72 79 7d 0a 0a 0a 5c 62 |\end{ent|ry}...\b|
|00003170| 65 67 69 6e 7b 65 6e 74 | 72 79 7d 7b 25 0a 5c 70 |egin{ent|ry}{%.\p|
|00003180| 72 6f 74 6f 7b 61 6e 64 | 7d 7b 20 5c 68 79 70 65 |roto{and|}{ \hype|
|00003190| 72 69 7b 74 65 73 74 7d | 20 5c 64 6f 74 73 66 6f |ri{test}| \dotsfo|
|000031a0| 6f 7d 7b 65 73 73 65 6e | 74 69 61 6c 20 5c 65 78 |o}{essen|tial \ex|
|000031b0| 70 72 74 79 70 65 7d 7d | 0a 0a 54 68 65 20 5c 68 |prtype}}|..The \h|
|000031c0| 79 70 65 72 7b 74 65 73 | 74 7d 20 65 78 70 72 65 |yper{tes|t} expre|
|000031d0| 73 73 69 6f 6e 73 20 61 | 72 65 20 65 76 61 6c 75 |ssions a|re evalu|
|000031e0| 61 74 65 64 20 66 72 6f | 6d 20 6c 65 66 74 20 74 |ated fro|m left t|
|000031f0| 6f 20 72 69 67 68 74 2c | 20 61 6e 64 20 74 68 65 |o right,| and the|
|00003200| 0a 76 61 6c 75 65 20 6f | 66 20 74 68 65 20 66 69 |.value o|f the fi|
|00003210| 72 73 74 20 65 78 70 72 | 65 73 73 69 6f 6e 20 74 |rst expr|ession t|
|00003220| 68 61 74 20 65 76 61 6c | 75 61 74 65 73 20 74 6f |hat eval|uates to|
|00003230| 20 61 20 66 61 6c 73 65 | 20 76 61 6c 75 65 20 28 | a false| value (|
|00003240| 73 65 65 0a 73 65 63 74 | 69 6f 6e 7e 5c 72 65 66 |see.sect|ion~\ref|
|00003250| 7b 62 6f 6f 6c 65 61 6e | 73 65 63 74 69 6f 6e 7d |{boolean|section}|
|00003260| 29 20 69 73 20 72 65 74 | 75 72 6e 65 64 2e 20 20 |) is ret|urned. |
|00003270| 41 6e 79 20 72 65 6d 61 | 69 6e 69 6e 67 20 65 78 |Any rema|ining ex|
|00003280| 70 72 65 73 73 69 6f 6e | 73 0a 61 72 65 20 6e 6f |pression|s.are no|
|00003290| 74 20 65 76 61 6c 75 61 | 74 65 64 2e 20 20 49 66 |t evalua|ted. If|
|000032a0| 20 61 6c 6c 20 74 68 65 | 20 65 78 70 72 65 73 73 | all the| express|
|000032b0| 69 6f 6e 73 20 65 76 61 | 6c 75 61 74 65 20 74 6f |ions eva|luate to|
|000032c0| 20 74 72 75 65 20 76 61 | 6c 75 65 73 2c 20 74 68 | true va|lues, th|
|000032d0| 65 0a 76 61 6c 75 65 20 | 6f 66 20 74 68 65 20 6c |e.value |of the l|
|000032e0| 61 73 74 20 65 78 70 72 | 65 73 73 69 6f 6e 20 69 |ast expr|ession i|
|000032f0| 73 20 72 65 74 75 72 6e | 65 64 2e 20 20 49 66 20 |s return|ed. If |
|00003300| 74 68 65 72 65 20 61 72 | 65 20 6e 6f 20 65 78 70 |there ar|e no exp|
|00003310| 72 65 73 73 69 6f 6e 73 | 0a 74 68 65 6e 20 5c 73 |ressions|.then \s|
|00003320| 63 68 74 72 75 65 7b 7d | 20 69 73 20 72 65 74 75 |chtrue{}| is retu|
|00003330| 72 6e 65 64 2e 0a 0a 5c | 62 65 67 69 6e 7b 73 63 |rned...\|begin{sc|
|00003340| 68 65 6d 65 7d 0a 28 61 | 6e 64 20 28 3d 20 32 20 |heme}.(a|nd (= 2 |
|00003350| 32 29 20 28 3e 20 32 20 | 31 29 29 20 20 20 20 20 |2) (> 2 |1)) |
|00003360| 20 20 20 20 20 20 5c 65 | 76 20 20 5c 73 63 68 74 | \e|v \scht|
|00003370| 72 75 65 0a 28 61 6e 64 | 20 28 3d 20 32 20 32 29 |rue.(and| (= 2 2)|
|00003380| 20 28 3c 20 32 20 31 29 | 29 20 20 20 20 20 20 20 | (< 2 1)|) |
|00003390| 20 20 20 20 5c 65 76 20 | 20 5c 73 63 68 66 61 6c | \ev | \schfal|
|000033a0| 73 65 0a 28 61 6e 64 20 | 31 20 32 20 27 63 20 27 |se.(and |1 2 'c '|
|000033b0| 28 66 20 67 29 29 20 20 | 20 20 20 20 20 20 20 20 |(f g)) | |
|000033c0| 20 20 20 5c 65 76 20 20 | 28 66 20 67 29 0a 28 61 | \ev |(f g).(a|
|000033d0| 6e 64 29 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |nd) | |
|000033e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 5c 65 | | \e|
|000033f0| 76 20 20 5c 73 63 68 74 | 72 75 65 25 0a 5c 65 6e |v \scht|rue%.\en|
|00003400| 64 7b 73 63 68 65 6d 65 | 7d 0a 0a 5c 65 6e 64 7b |d{scheme|}..\end{|
|00003410| 65 6e 74 72 79 7d 0a 0a | 0a 5c 62 65 67 69 6e 7b |entry}..|.\begin{|
|00003420| 65 6e 74 72 79 7d 7b 25 | 0a 5c 70 72 6f 74 6f 7b |entry}{%|.\proto{|
|00003430| 6f 72 7d 7b 20 5c 68 79 | 70 65 72 69 7b 74 65 73 |or}{ \hy|peri{tes|
|00003440| 74 7d 20 5c 64 6f 74 73 | 66 6f 6f 7d 7b 65 73 73 |t} \dots|foo}{ess|
|00003450| 65 6e 74 69 61 6c 20 5c | 65 78 70 72 74 79 70 65 |ential \|exprtype|
|00003460| 7d 7d 0a 0a 54 68 65 20 | 5c 68 79 70 65 72 7b 74 |}}..The |\hyper{t|
|00003470| 65 73 74 7d 20 65 78 70 | 72 65 73 73 69 6f 6e 73 |est} exp|ressions|
|00003480| 20 61 72 65 20 65 76 61 | 6c 75 61 74 65 64 20 66 | are eva|luated f|
|00003490| 72 6f 6d 20 6c 65 66 74 | 20 74 6f 20 72 69 67 68 |rom left| to righ|
|000034a0| 74 2c 20 61 6e 64 20 74 | 68 65 20 76 61 6c 75 65 |t, and t|he value|
|000034b0| 20 6f 66 20 74 68 65 0a | 66 69 72 73 74 20 65 78 | of the.|first ex|
|000034c0| 70 72 65 73 73 69 6f 6e | 20 74 68 61 74 20 65 76 |pression| that ev|
|000034d0| 61 6c 75 61 74 65 73 20 | 74 6f 20 61 20 74 72 75 |aluates |to a tru|
|000034e0| 65 20 76 61 6c 75 65 20 | 28 73 65 65 0a 73 65 63 |e value |(see.sec|
|000034f0| 74 69 6f 6e 7e 5c 72 65 | 66 7b 62 6f 6f 6c 65 61 |tion~\re|f{boolea|
|00003500| 6e 73 65 63 74 69 6f 6e | 7d 29 20 69 73 20 72 65 |nsection|}) is re|
|00003510| 74 75 72 6e 65 64 2e 20 | 20 41 6e 79 20 72 65 6d |turned. | Any rem|
|00003520| 61 69 6e 69 6e 67 20 65 | 78 70 72 65 73 73 69 6f |aining e|xpressio|
|00003530| 6e 73 0a 61 72 65 20 6e | 6f 74 20 65 76 61 6c 75 |ns.are n|ot evalu|
|00003540| 61 74 65 64 2e 20 20 49 | 66 20 61 6c 6c 20 65 78 |ated. I|f all ex|
|00003550| 70 72 65 73 73 69 6f 6e | 73 20 65 76 61 6c 75 61 |pression|s evalua|
|00003560| 74 65 20 74 6f 20 66 61 | 6c 73 65 20 76 61 6c 75 |te to fa|lse valu|
|00003570| 65 73 2c 20 74 68 65 0a | 76 61 6c 75 65 20 6f 66 |es, the.|value of|
|00003580| 20 74 68 65 20 6c 61 73 | 74 20 65 78 70 72 65 73 | the las|t expres|
|00003590| 73 69 6f 6e 20 69 73 20 | 72 65 74 75 72 6e 65 64 |sion is |returned|
|000035a0| 2e 20 20 49 66 20 74 68 | 65 72 65 20 61 72 65 20 |. If th|ere are |
|000035b0| 6e 6f 0a 65 78 70 72 65 | 73 73 69 6f 6e 73 20 74 |no.expre|ssions t|
|000035c0| 68 65 6e 20 5c 73 63 68 | 66 61 6c 73 65 7b 7d 20 |hen \sch|false{} |
|000035d0| 69 73 20 72 65 74 75 72 | 6e 65 64 2e 0a 0a 5c 62 |is retur|ned...\b|
|000035e0| 65 67 69 6e 7b 73 63 68 | 65 6d 65 7d 0a 28 6f 72 |egin{sch|eme}.(or|
|000035f0| 20 28 3d 20 32 20 32 29 | 20 28 3e 20 32 20 31 29 | (= 2 2)| (> 2 1)|
|00003600| 29 20 20 20 20 20 20 20 | 20 20 20 20 20 5c 65 76 |) | \ev|
|00003610| 20 20 5c 73 63 68 74 72 | 75 65 0a 28 6f 72 20 28 | \schtr|ue.(or (|
|00003620| 3d 20 32 20 32 29 20 28 | 3c 20 32 20 31 29 29 20 |= 2 2) (|< 2 1)) |
|00003630| 20 20 20 20 20 20 20 20 | 20 20 20 5c 65 76 20 20 | | \ev |
|00003640| 5c 73 63 68 74 72 75 65 | 0a 28 6f 72 20 5c 73 63 |\schtrue|.(or \sc|
|00003650| 68 66 61 6c 73 65 20 5c | 73 63 68 66 61 6c 73 65 |hfalse \|schfalse|
|00003660| 20 5c 73 63 68 66 61 6c | 73 65 29 20 5c 65 76 20 | \schfal|se) \ev |
|00003670| 20 5c 73 63 68 66 61 6c | 73 65 0a 28 6f 72 20 28 | \schfal|se.(or (|
|00003680| 6d 65 6d 71 20 27 62 20 | 27 28 61 20 62 20 63 29 |memq 'b |'(a b c)|
|00003690| 29 20 0a 20 20 20 20 28 | 2f 20 33 20 30 29 29 20 |) . (|/ 3 0)) |
|000036a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000036b0| 20 20 20 5c 65 76 20 20 | 28 62 20 63 29 25 0a 5c | \ev |(b c)%.\|
|000036c0| 65 6e 64 7b 73 63 68 65 | 6d 65 7d 0a 0a 5c 65 6e |end{sche|me}..\en|
|000036d0| 64 7b 65 6e 74 72 79 7d | 0a 0a 0a 5c 73 75 62 73 |d{entry}|...\subs|
|000036e0| 65 63 74 69 6f 6e 7b 42 | 69 6e 64 69 6e 67 20 63 |ection{B|inding c|
|000036f0| 6f 6e 73 74 72 75 63 74 | 73 7d 0a 0a 54 68 65 20 |onstruct|s}..The |
|00003700| 74 68 72 65 65 20 62 69 | 6e 64 69 6e 67 20 63 6f |three bi|nding co|
|00003710| 6e 73 74 72 75 63 74 73 | 20 5c 69 64 65 7b 6c 65 |nstructs| \ide{le|
|00003720| 74 7d 2c 20 5c 69 64 65 | 7b 6c 65 74 2a 7d 2c 20 |t}, \ide|{let*}, |
|00003730| 61 6e 64 20 5c 69 64 65 | 7b 6c 65 74 72 65 63 7d |and \ide|{letrec}|
|00003740| 0a 67 69 76 65 20 53 63 | 68 65 6d 65 20 61 20 62 |.give Sc|heme a b|
|00003750| 6c 6f 63 6b 20 73 74 72 | 75 63 74 75 72 65 2c 20 |lock str|ucture, |
|00003760| 6c 69 6b 65 20 41 6c 67 | 6f 6c 20 36 30 2e 20 20 |like Alg|ol 60. |
|00003770| 54 68 65 20 73 79 6e 74 | 61 78 20 6f 66 20 74 68 |The synt|ax of th|
|00003780| 65 20 74 68 72 65 65 0a | 63 6f 6e 73 74 72 75 63 |e three.|construc|
|00003790| 74 73 20 69 73 20 69 64 | 65 6e 74 69 63 61 6c 2c |ts is id|entical,|
|000037a0| 20 62 75 74 20 74 68 65 | 79 20 64 69 66 66 65 72 | but the|y differ|
|000037b0| 20 69 6e 20 74 68 65 20 | 72 65 67 69 6f 6e 73 5c | in the |regions\|
|000037c0| 69 6e 64 65 78 7b 72 65 | 67 69 6f 6e 7d 20 74 68 |index{re|gion} th|
|000037d0| 65 79 20 65 73 74 61 62 | 6c 69 73 68 0a 66 6f 72 |ey estab|lish.for|
|000037e0| 20 74 68 65 69 72 20 76 | 61 72 69 61 62 6c 65 20 | their v|ariable |
|000037f0| 62 69 6e 64 69 6e 67 73 | 2e 20 20 49 6e 20 61 20 |bindings|. In a |
|00003800| 5c 69 64 65 7b 6c 65 74 | 7d 20 65 78 70 72 65 73 |\ide{let|} expres|
|00003810| 73 69 6f 6e 2c 20 74 68 | 65 20 69 6e 69 74 69 61 |sion, th|e initia|
|00003820| 6c 0a 76 61 6c 75 65 73 | 20 61 72 65 20 63 6f 6d |l.values| are com|
|00003830| 70 75 74 65 64 20 62 65 | 66 6f 72 65 20 61 6e 79 |puted be|fore any|
|00003840| 20 6f 66 20 74 68 65 20 | 76 61 72 69 61 62 6c 65 | of the |variable|
|00003850| 73 20 62 65 63 6f 6d 65 | 20 62 6f 75 6e 64 3b 20 |s become| bound; |
|00003860| 69 6e 20 61 0a 5c 69 64 | 65 7b 6c 65 74 2a 7d 20 |in a.\id|e{let*} |
|00003870| 65 78 70 72 65 73 73 69 | 6f 6e 2c 20 74 68 65 20 |expressi|on, the |
|00003880| 62 69 6e 64 69 6e 67 73 | 20 61 6e 64 20 65 76 61 |bindings| and eva|
|00003890| 6c 75 61 74 69 6f 6e 73 | 20 61 72 65 20 70 65 72 |luations| are per|
|000038a0| 66 6f 72 6d 65 64 0a 73 | 65 71 75 65 6e 74 69 61 |formed.s|equentia|
|000038b0| 6c 6c 79 3b 20 77 68 69 | 6c 65 20 69 6e 20 61 20 |lly; whi|le in a |
|000038c0| 5c 69 64 65 7b 6c 65 74 | 72 65 63 7d 20 65 78 70 |\ide{let|rec} exp|
|000038d0| 72 65 73 73 69 6f 6e 2c | 20 61 6c 6c 20 74 68 65 |ression,| all the|
|000038e0| 20 62 69 6e 64 69 6e 67 | 73 20 61 72 65 20 69 6e | binding|s are in|
|000038f0| 0a 65 66 66 65 63 74 20 | 77 68 69 6c 65 20 74 68 |.effect |while th|
|00003900| 65 69 72 20 69 6e 69 74 | 69 61 6c 20 76 61 6c 75 |eir init|ial valu|
|00003910| 65 73 20 61 72 65 20 62 | 65 69 6e 67 20 63 6f 6d |es are b|eing com|
|00003920| 70 75 74 65 64 2c 20 74 | 68 75 73 20 61 6c 6c 6f |puted, t|hus allo|
|00003930| 77 69 6e 67 0a 6d 75 74 | 75 61 6c 6c 79 20 72 65 |wing.mut|ually re|
|00003940| 63 75 72 73 69 76 65 20 | 64 65 66 69 6e 69 74 69 |cursive |definiti|
|00003950| 6f 6e 73 2e 0a 0a 5c 62 | 65 67 69 6e 7b 65 6e 74 |ons...\b|egin{ent|
|00003960| 72 79 7d 7b 25 0a 5c 70 | 72 6f 74 6f 7b 6c 65 74 |ry}{%.\p|roto{let|
|00003970| 7d 7b 20 5c 68 79 70 65 | 72 7b 62 69 6e 64 69 6e |}{ \hype|r{bindin|
|00003980| 67 73 7d 20 5c 68 79 70 | 65 72 7b 62 6f 64 79 7d |gs} \hyp|er{body}|
|00003990| 7d 7b 65 73 73 65 6e 74 | 69 61 6c 20 5c 65 78 70 |}{essent|ial \exp|
|000039a0| 72 74 79 70 65 7d 7d 0a | 0a 5c 73 79 6e 74 61 78 |rtype}}.|.\syntax|
|000039b0| 0a 5c 68 79 70 65 72 7b | 42 69 6e 64 69 6e 67 73 |.\hyper{|Bindings|
|000039c0| 7d 20 73 68 6f 75 6c 64 | 20 68 61 76 65 20 74 68 |} should| have th|
|000039d0| 65 20 66 6f 72 6d 0a 5c | 62 65 67 69 6e 7b 73 63 |e form.\|begin{sc|
|000039e0| 68 65 6d 65 7d 0a 28 28 | 5c 68 79 70 65 72 69 7b |heme}.((|\hyperi{|
|000039f0| 76 61 72 69 61 62 6c 65 | 7d 20 5c 68 79 70 65 72 |variable|} \hyper|
|00003a00| 69 7b 69 6e 69 74 7d 29 | 20 5c 64 6f 74 73 66 6f |i{init})| \dotsfo|
|00003a10| 6f 29 5c 72 6d 2c 25 0a | 5c 65 6e 64 7b 73 63 68 |o)\rm,%.|\end{sch|
|00003a20| 65 6d 65 7d 0a 77 68 65 | 72 65 20 65 61 63 68 20 |eme}.whe|re each |
|00003a30| 5c 68 79 70 65 72 7b 69 | 6e 69 74 7d 20 69 73 20 |\hyper{i|nit} is |
|00003a40| 61 6e 20 65 78 70 72 65 | 73 73 69 6f 6e 2c 20 61 |an expre|ssion, a|
|00003a50| 6e 64 20 5c 68 79 70 65 | 72 7b 62 6f 64 79 7d 20 |nd \hype|r{body} |
|00003a60| 73 68 6f 75 6c 64 20 62 | 65 20 61 0a 73 65 71 75 |should b|e a.sequ|
|00003a70| 65 6e 63 65 20 6f 66 20 | 6f 6e 65 20 6f 72 20 6d |ence of |one or m|
|00003a80| 6f 72 65 20 65 78 70 72 | 65 73 73 69 6f 6e 73 2e |ore expr|essions.|
|00003a90| 20 20 49 74 20 69 73 20 | 61 6e 20 65 72 72 6f 72 | It is |an error|
|00003aa0| 20 66 6f 72 20 61 20 5c | 68 79 70 65 72 7b 76 61 | for a \|hyper{va|
|00003ab0| 72 69 61 62 6c 65 7d 0a | 74 6f 20 61 70 70 65 61 |riable}.|to appea|
|00003ac0| 72 20 6d 6f 72 65 20 74 | 68 61 6e 20 6f 6e 63 65 |r more t|han once|
|00003ad0| 20 69 6e 20 74 68 65 20 | 6c 69 73 74 20 6f 66 20 | in the |list of |
|00003ae0| 76 61 72 69 61 62 6c 65 | 73 20 62 65 69 6e 67 20 |variable|s being |
|00003af0| 62 6f 75 6e 64 2e 0a 0a | 5c 73 65 6d 61 6e 74 69 |bound...|\semanti|
|00003b00| 63 73 0a 54 68 65 20 5c | 68 79 70 65 72 7b 69 6e |cs.The \|hyper{in|
|00003b10| 69 74 7d 73 20 61 72 65 | 20 65 76 61 6c 75 61 74 |it}s are| evaluat|
|00003b20| 65 64 20 69 6e 20 74 68 | 65 20 63 75 72 72 65 6e |ed in th|e curren|
|00003b30| 74 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 20 28 69 |t enviro|nment (i|
|00003b40| 6e 20 73 6f 6d 65 0a 75 | 6e 73 70 65 63 69 66 69 |n some.u|nspecifi|
|00003b50| 65 64 20 6f 72 64 65 72 | 29 2c 20 74 68 65 20 5c |ed order|), the \|
|00003b60| 68 79 70 65 72 7b 76 61 | 72 69 61 62 6c 65 7d 73 |hyper{va|riable}s|
|00003b70| 20 61 72 65 20 62 6f 75 | 6e 64 20 74 6f 20 66 72 | are bou|nd to fr|
|00003b80| 65 73 68 20 6c 6f 63 61 | 74 69 6f 6e 73 0a 68 6f |esh loca|tions.ho|
|00003b90| 6c 64 69 6e 67 20 74 68 | 65 20 72 65 73 75 6c 74 |lding th|e result|
|00003ba0| 73 2c 20 74 68 65 20 5c | 68 79 70 65 72 7b 62 6f |s, the \|hyper{bo|
|00003bb0| 64 79 7d 20 69 73 20 65 | 76 61 6c 75 61 74 65 64 |dy} is e|valuated|
|00003bc0| 20 69 6e 20 74 68 65 20 | 65 78 74 65 6e 64 65 64 | in the |extended|
|00003bd0| 0a 65 6e 76 69 72 6f 6e | 6d 65 6e 74 2c 20 61 6e |.environ|ment, an|
|00003be0| 64 20 74 68 65 20 76 61 | 6c 75 65 20 6f 66 20 74 |d the va|lue of t|
|00003bf0| 68 65 20 6c 61 73 74 20 | 65 78 70 72 65 73 73 69 |he last |expressi|
|00003c00| 6f 6e 20 6f 66 20 5c 68 | 79 70 65 72 7b 62 6f 64 |on of \h|yper{bod|
|00003c10| 79 7d 20 69 73 0a 72 65 | 74 75 72 6e 65 64 2e 20 |y} is.re|turned. |
|00003c20| 20 45 61 63 68 20 62 69 | 6e 64 69 6e 67 20 6f 66 | Each bi|nding of|
|00003c30| 20 61 20 5c 68 79 70 65 | 72 7b 76 61 72 69 61 62 | a \hype|r{variab|
|00003c40| 6c 65 7d 20 68 61 73 20 | 5c 68 79 70 65 72 7b 62 |le} has |\hyper{b|
|00003c50| 6f 64 79 7d 20 61 73 20 | 69 74 73 0a 72 65 67 69 |ody} as |its.regi|
|00003c60| 6f 6e 2e 5c 69 6e 64 65 | 78 7b 72 65 67 69 6f 6e |on.\inde|x{region|
|00003c70| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 73 63 68 65 6d 65 |}..\begi|n{scheme|
|00003c80| 7d 0a 28 6c 65 74 20 28 | 28 78 20 32 29 20 28 79 |}.(let (|(x 2) (y|
|00003c90| 20 33 29 29 0a 20 20 28 | 2a 20 78 20 79 29 29 20 | 3)). (|* x y)) |
|00003ca0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003cb0| 20 20 20 20 20 5c 65 76 | 20 20 36 0a 0a 28 6c 65 | \ev| 6..(le|
|00003cc0| 74 20 28 28 78 20 32 29 | 20 28 79 20 33 29 29 0a |t ((x 2)| (y 3)).|
|00003cd0| 20 20 28 6c 65 74 20 28 | 28 66 6f 6f 20 28 6c 61 | (let (|(foo (la|
|00003ce0| 6d 62 64 61 20 28 7a 29 | 20 28 2b 20 78 20 79 20 |mbda (z)| (+ x y |
|00003cf0| 7a 29 29 29 0a 20 20 20 | 20 20 20 20 20 28 78 20 |z))). | (x |
|00003d00| 37 29 29 0a 20 20 20 20 | 28 66 6f 6f 20 34 29 29 |7)). |(foo 4))|
|00003d10| 29 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |) | |
|00003d20| 20 20 20 20 5c 65 76 20 | 20 39 25 0a 5c 65 6e 64 | \ev | 9%.\end|
|00003d30| 7b 73 63 68 65 6d 65 7d | 0a 0a 53 65 65 20 61 6c |{scheme}|..See al|
|00003d40| 73 6f 20 6e 61 6d 65 64 | 20 5c 69 64 65 7b 6c 65 |so named| \ide{le|
|00003d50| 74 7d 2c 20 73 65 63 74 | 69 6f 6e 20 5c 72 65 66 |t}, sect|ion \ref|
|00003d60| 7b 6e 61 6d 65 64 6c 65 | 74 7d 2e 0a 0a 5c 65 6e |{namedle|t}...\en|
|00003d70| 64 7b 65 6e 74 72 79 7d | 0a 0a 0a 5c 62 65 67 69 |d{entry}|...\begi|
|00003d80| 6e 7b 65 6e 74 72 79 7d | 7b 25 0a 5c 70 72 6f 74 |n{entry}|{%.\prot|
|00003d90| 6f 7b 6c 65 74 2a 7d 7b | 20 5c 68 79 70 65 72 7b |o{let*}{| \hyper{|
|00003da0| 62 69 6e 64 69 6e 67 73 | 7d 20 5c 68 79 70 65 72 |bindings|} \hyper|
|00003db0| 7b 62 6f 64 79 7d 7d 7b | 5c 65 78 70 72 74 79 70 |{body}}{|\exprtyp|
|00003dc0| 65 7d 7d 5c 6e 6f 62 72 | 65 61 6b 0a 0a 5c 6e 6f |e}}\nobr|eak..\no|
|00003dd0| 62 72 65 61 6b 0a 5c 73 | 79 6e 74 61 78 0a 5c 68 |break.\s|yntax.\h|
|00003de0| 79 70 65 72 7b 42 69 6e | 64 69 6e 67 73 7d 20 73 |yper{Bin|dings} s|
|00003df0| 68 6f 75 6c 64 20 68 61 | 76 65 20 74 68 65 20 66 |hould ha|ve the f|
|00003e00| 6f 72 6d 0a 5c 62 65 67 | 69 6e 7b 73 63 68 65 6d |orm.\beg|in{schem|
|00003e10| 65 7d 0a 28 28 5c 68 79 | 70 65 72 69 7b 76 61 72 |e}.((\hy|peri{var|
|00003e20| 69 61 62 6c 65 7d 20 5c | 68 79 70 65 72 69 7b 69 |iable} \|hyperi{i|
|00003e30| 6e 69 74 7d 29 20 5c 64 | 6f 74 73 66 6f 6f 29 5c |nit}) \d|otsfoo)\|
|00003e40| 72 6d 2c 25 0a 5c 65 6e | 64 7b 73 63 68 65 6d 65 |rm,%.\en|d{scheme|
|00003e50| 7d 0a 61 6e 64 20 5c 68 | 79 70 65 72 7b 62 6f 64 |}.and \h|yper{bod|
|00003e60| 79 7d 20 73 68 6f 75 6c | 64 20 62 65 20 61 20 73 |y} shoul|d be a s|
|00003e70| 65 71 75 65 6e 63 65 20 | 6f 66 20 6f 6e 65 20 6f |equence |of one o|
|00003e80| 72 20 6d 6f 72 65 20 65 | 78 70 72 65 73 73 69 6f |r more e|xpressio|
|00003e90| 6e 73 2e 0a 0a 5c 73 65 | 6d 61 6e 74 69 63 73 0a |ns...\se|mantics.|
|00003ea0| 5c 69 64 65 7b 4c 65 74 | 2a 7d 20 69 73 20 73 69 |\ide{Let|*} is si|
|00003eb0| 6d 69 6c 61 72 20 74 6f | 20 5c 69 64 65 7b 6c 65 |milar to| \ide{le|
|00003ec0| 74 7d 2c 20 62 75 74 20 | 74 68 65 20 62 69 6e 64 |t}, but |the bind|
|00003ed0| 69 6e 67 73 20 61 72 65 | 20 70 65 72 66 6f 72 6d |ings are| perform|
|00003ee0| 65 64 0a 73 65 71 75 65 | 6e 74 69 61 6c 6c 79 20 |ed.seque|ntially |
|00003ef0| 66 72 6f 6d 20 6c 65 66 | 74 20 74 6f 20 72 69 67 |from lef|t to rig|
|00003f00| 68 74 2c 20 61 6e 64 20 | 74 68 65 20 72 65 67 69 |ht, and |the regi|
|00003f10| 6f 6e 5c 69 6e 64 65 78 | 7b 72 65 67 69 6f 6e 7d |on\index|{region}|
|00003f20| 20 6f 66 20 61 20 62 69 | 6e 64 69 6e 67 20 69 6e | of a bi|nding in|
|00003f30| 64 69 63 61 74 65 64 0a | 62 79 20 7b 5c 63 66 28 |dicated.|by {\cf(|
|00003f40| 5c 68 79 70 65 72 7b 76 | 61 72 69 61 62 6c 65 7d |\hyper{v|ariable}|
|00003f50| 20 5c 68 79 70 65 72 7b | 69 6e 69 74 7d 29 7d 20 | \hyper{|init})} |
|00003f60| 69 73 20 74 68 61 74 20 | 70 61 72 74 20 6f 66 20 |is that |part of |
|00003f70| 74 68 65 20 5c 69 64 65 | 7b 6c 65 74 2a 7d 0a 65 |the \ide|{let*}.e|
|00003f80| 78 70 72 65 73 73 69 6f | 6e 20 74 6f 20 74 68 65 |xpressio|n to the|
|00003f90| 20 72 69 67 68 74 20 6f | 66 20 74 68 65 20 62 69 | right o|f the bi|
|00003fa0| 6e 64 69 6e 67 2e 20 20 | 54 68 75 73 20 74 68 65 |nding. |Thus the|
|00003fb0| 20 73 65 63 6f 6e 64 20 | 62 69 6e 64 69 6e 67 20 | second |binding |
|00003fc0| 69 73 20 64 6f 6e 65 0a | 69 6e 20 61 6e 20 65 6e |is done.|in an en|
|00003fd0| 76 69 72 6f 6e 6d 65 6e | 74 20 69 6e 20 77 68 69 |vironmen|t in whi|
|00003fe0| 63 68 20 74 68 65 20 66 | 69 72 73 74 20 62 69 6e |ch the f|irst bin|
|00003ff0| 64 69 6e 67 20 69 73 20 | 76 69 73 69 62 6c 65 2c |ding is |visible,|
|00004000| 20 61 6e 64 20 73 6f 20 | 6f 6e 2e 0a 0a 5c 62 65 | and so |on...\be|
|00004010| 67 69 6e 7b 73 63 68 65 | 6d 65 7d 0a 28 6c 65 74 |gin{sche|me}.(let|
|00004020| 2a 20 28 28 78 20 31 29 | 20 28 79 20 28 2b 20 78 |* ((x 1)| (y (+ x|
|00004030| 20 31 29 29 29 0a 20 20 | 79 29 20 20 20 20 20 20 | 1))). |y) |
|00004040| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004050| 5c 65 76 20 20 32 25 0a | 5c 65 6e 64 7b 73 63 68 |\ev 2%.|\end{sch|
|00004060| 65 6d 65 7d 0a 0a 5c 65 | 6e 64 7b 65 6e 74 72 79 |eme}..\e|nd{entry|
|00004070| 7d 0a 0a 0a 5c 62 65 67 | 69 6e 7b 65 6e 74 72 79 |}...\beg|in{entry|
|00004080| 7d 7b 25 0a 5c 70 72 6f | 74 6f 7b 6c 65 74 72 65 |}{%.\pro|to{letre|
|00004090| 63 7d 7b 20 5c 68 79 70 | 65 72 7b 62 69 6e 64 69 |c}{ \hyp|er{bindi|
|000040a0| 6e 67 73 7d 20 5c 68 79 | 70 65 72 7b 62 6f 64 79 |ngs} \hy|per{body|
|000040b0| 7d 7d 7b 65 73 73 65 6e | 74 69 61 6c 20 5c 65 78 |}}{essen|tial \ex|
|000040c0| 70 72 74 79 70 65 7d 7d | 0a 0a 5c 73 79 6e 74 61 |prtype}}|..\synta|
|000040d0| 78 0a 5c 68 79 70 65 72 | 7b 42 69 6e 64 69 6e 67 |x.\hyper|{Binding|
|000040e0| 73 7d 20 73 68 6f 75 6c | 64 20 68 61 76 65 20 74 |s} shoul|d have t|
|000040f0| 68 65 20 66 6f 72 6d 0a | 5c 62 65 67 69 6e 7b 73 |he form.|\begin{s|
|00004100| 63 68 65 6d 65 7d 0a 28 | 28 5c 68 79 70 65 72 69 |cheme}.(|(\hyperi|
|00004110| 7b 76 61 72 69 61 62 6c | 65 7d 20 5c 68 79 70 65 |{variabl|e} \hype|
|00004120| 72 69 7b 69 6e 69 74 7d | 29 20 5c 64 6f 74 73 66 |ri{init}|) \dotsf|
|00004130| 6f 6f 29 5c 72 6d 2c 25 | 0a 5c 65 6e 64 7b 73 63 |oo)\rm,%|.\end{sc|
|00004140| 68 65 6d 65 7d 0a 61 6e | 64 20 5c 68 79 70 65 72 |heme}.an|d \hyper|
|00004150| 7b 62 6f 64 79 7d 20 73 | 68 6f 75 6c 64 20 62 65 |{body} s|hould be|
|00004160| 20 61 20 73 65 71 75 65 | 6e 63 65 20 6f 66 20 6f | a seque|nce of o|
|00004170| 6e 65 20 6f 72 20 6d 6f | 72 65 20 65 78 70 72 65 |ne or mo|re expre|
|00004180| 73 73 69 6f 6e 73 2e 0a | 49 74 20 69 73 20 61 6e |ssions..|It is an|
|00004190| 20 65 72 72 6f 72 20 66 | 6f 72 20 61 20 5c 68 79 | error f|or a \hy|
|000041a0| 70 65 72 7b 76 61 72 69 | 61 62 6c 65 7d 20 74 6f |per{vari|able} to|
|000041b0| 20 61 70 70 65 61 72 20 | 6d 6f 72 65 20 74 68 61 | appear |more tha|
|000041c0| 6e 20 6f 6e 63 65 20 69 | 6e 0a 74 68 65 20 6c 69 |n once i|n.the li|
|000041d0| 73 74 20 6f 66 20 76 61 | 72 69 61 62 6c 65 73 20 |st of va|riables |
|000041e0| 62 65 69 6e 67 20 62 6f | 75 6e 64 2e 0a 0a 5c 73 |being bo|und...\s|
|000041f0| 65 6d 61 6e 74 69 63 73 | 0a 54 68 65 20 5c 68 79 |emantics|.The \hy|
|00004200| 70 65 72 7b 76 61 72 69 | 61 62 6c 65 7d 73 20 61 |per{vari|able}s a|
|00004210| 72 65 20 62 6f 75 6e 64 | 20 74 6f 20 66 72 65 73 |re bound| to fres|
|00004220| 68 20 6c 6f 63 61 74 69 | 6f 6e 73 20 68 6f 6c 64 |h locati|ons hold|
|00004230| 69 6e 67 20 75 6e 64 65 | 66 69 6e 65 64 0a 76 61 |ing unde|fined.va|
|00004240| 6c 75 65 73 2c 20 74 68 | 65 20 5c 68 79 70 65 72 |lues, th|e \hyper|
|00004250| 7b 69 6e 69 74 7d 73 20 | 61 72 65 20 65 76 61 6c |{init}s |are eval|
|00004260| 75 61 74 65 64 20 69 6e | 20 74 68 65 20 72 65 73 |uated in| the res|
|00004270| 75 6c 74 69 6e 67 20 65 | 6e 76 69 72 6f 6e 6d 65 |ulting e|nvironme|
|00004280| 6e 74 20 28 69 6e 0a 73 | 6f 6d 65 20 75 6e 73 70 |nt (in.s|ome unsp|
|00004290| 65 63 69 66 69 65 64 20 | 6f 72 64 65 72 29 2c 20 |ecified |order), |
|000042a0| 65 61 63 68 20 5c 68 79 | 70 65 72 7b 76 61 72 69 |each \hy|per{vari|
|000042b0| 61 62 6c 65 7d 20 69 73 | 20 61 73 73 69 67 6e 65 |able} is| assigne|
|000042c0| 64 20 74 6f 20 74 68 65 | 20 72 65 73 75 6c 74 0a |d to the| result.|
|000042d0| 6f 66 20 74 68 65 20 63 | 6f 72 72 65 73 70 6f 6e |of the c|orrespon|
|000042e0| 64 69 6e 67 20 5c 68 79 | 70 65 72 7b 69 6e 69 74 |ding \hy|per{init|
|000042f0| 7d 2c 20 74 68 65 20 5c | 68 79 70 65 72 7b 62 6f |}, the \|hyper{bo|
|00004300| 64 79 7d 20 69 73 20 65 | 76 61 6c 75 61 74 65 64 |dy} is e|valuated|
|00004310| 20 69 6e 20 74 68 65 0a | 72 65 73 75 6c 74 69 6e | in the.|resultin|
|00004320| 67 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 2c 20 61 |g enviro|nment, a|
|00004330| 6e 64 20 74 68 65 20 76 | 61 6c 75 65 20 6f 66 20 |nd the v|alue of |
|00004340| 74 68 65 20 6c 61 73 74 | 20 65 78 70 72 65 73 73 |the last| express|
|00004350| 69 6f 6e 20 69 6e 0a 5c | 68 79 70 65 72 7b 62 6f |ion in.\|hyper{bo|
|00004360| 64 79 7d 20 69 73 20 72 | 65 74 75 72 6e 65 64 2e |dy} is r|eturned.|
|00004370| 20 20 45 61 63 68 20 62 | 69 6e 64 69 6e 67 20 6f | Each b|inding o|
|00004380| 66 20 61 20 5c 68 79 70 | 65 72 7b 76 61 72 69 61 |f a \hyp|er{varia|
|00004390| 62 6c 65 7d 20 68 61 73 | 20 74 68 65 0a 65 6e 74 |ble} has| the.ent|
|000043a0| 69 72 65 20 5c 69 64 65 | 7b 6c 65 74 72 65 63 7d |ire \ide|{letrec}|
|000043b0| 20 65 78 70 72 65 73 73 | 69 6f 6e 20 61 73 20 69 | express|ion as i|
|000043c0| 74 73 20 72 65 67 69 6f | 6e 5c 69 6e 64 65 78 7b |ts regio|n\index{|
|000043d0| 72 65 67 69 6f 6e 7d 2c | 20 6d 61 6b 69 6e 67 20 |region},| making |
|000043e0| 69 74 20 70 6f 73 73 69 | 62 6c 65 20 74 6f 0a 64 |it possi|ble to.d|
|000043f0| 65 66 69 6e 65 20 6d 75 | 74 75 61 6c 6c 79 20 72 |efine mu|tually r|
|00004400| 65 63 75 72 73 69 76 65 | 20 70 72 6f 63 65 64 75 |ecursive| procedu|
|00004410| 72 65 73 2e 0a 0a 5c 62 | 65 67 69 6e 7b 73 63 68 |res...\b|egin{sch|
|00004420| 65 6d 65 7d 0a 25 28 6c | 65 74 72 65 63 20 28 28 |eme}.%(l|etrec ((|
|00004430| 78 20 32 29 20 28 79 20 | 33 29 29 0a 25 20 20 28 |x 2) (y |3)).% (|
|00004440| 6c 65 74 72 65 63 20 28 | 28 66 6f 6f 20 28 6c 61 |letrec (|(foo (la|
|00004450| 6d 62 64 61 20 28 7a 29 | 20 28 2b 20 78 20 79 20 |mbda (z)| (+ x y |
|00004460| 7a 29 29 29 20 28 78 20 | 37 29 29 0a 25 20 20 20 |z))) (x |7)).% |
|00004470| 20 28 66 6f 6f 20 34 29 | 29 29 20 20 20 20 20 20 | (foo 4)|)) |
|00004480| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 5c 65 76 | | \ev|
|00004490| 20 20 31 34 0a 25 0a 28 | 6c 65 74 72 65 63 20 28 | 14.%.(|letrec (|
|000044a0| 28 65 76 65 6e 3f 0a 20 | 20 20 20 20 20 20 20 20 |(even?. | |
|000044b0| 20 28 6c 61 6d 62 64 61 | 20 28 6e 29 0a 20 20 20 | (lambda| (n). |
|000044c0| 20 20 20 20 20 20 20 20 | 20 28 69 66 20 28 7a 65 | | (if (ze|
|000044d0| 72 6f 3f 20 6e 29 0a 20 | 20 20 20 20 20 20 20 20 |ro? n). | |
|000044e0| 20 20 20 20 20 20 20 5c | 73 63 68 74 72 75 65 0a | \|schtrue.|
|000044f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004500| 28 6f 64 64 3f 20 28 2d | 20 6e 20 31 29 29 29 29 |(odd? (-| n 1))))|
|00004510| 29 0a 20 20 20 20 20 20 | 20 20 20 28 6f 64 64 3f |). | (odd?|
|00004520| 0a 20 20 20 20 20 20 20 | 20 20 20 28 6c 61 6d 62 |. | (lamb|
|00004530| 64 61 20 28 6e 29 0a 20 | 20 20 20 20 20 20 20 20 |da (n). | |
|00004540| 20 20 20 28 69 66 20 28 | 7a 65 72 6f 3f 20 6e 29 | (if (|zero? n)|
|00004550| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00004560| 20 5c 73 63 68 66 61 6c | 73 65 0a 20 20 20 20 20 | \schfal|se. |
|00004570| 20 20 20 20 20 20 20 20 | 20 20 20 28 65 76 65 6e | | (even|
|00004580| 3f 20 28 2d 20 6e 20 31 | 29 29 29 29 29 29 0a 20 |? (- n 1|)))))). |
|00004590| 20 28 65 76 65 6e 3f 20 | 38 38 29 29 20 20 20 0a | (even? |88)) .|
|000045a0| 09 09 5c 65 76 20 20 5c | 73 63 68 74 72 75 65 25 |..\ev \|schtrue%|
|000045b0| 0a 5c 65 6e 64 7b 73 63 | 68 65 6d 65 7d 0a 0a 4f |.\end{sc|heme}..O|
|000045c0| 6e 65 20 72 65 73 74 72 | 69 63 74 69 6f 6e 20 6f |ne restr|iction o|
|000045d0| 6e 20 5c 69 64 65 7b 6c | 65 74 72 65 63 7d 20 69 |n \ide{l|etrec} i|
|000045e0| 73 20 76 65 72 79 20 69 | 6d 70 6f 72 74 61 6e 74 |s very i|mportant|
|000045f0| 3a 20 69 74 20 6d 75 73 | 74 20 62 65 20 70 6f 73 |: it mus|t be pos|
|00004600| 73 69 62 6c 65 0a 74 6f | 20 65 76 61 6c 75 61 74 |sible.to| evaluat|
|00004610| 65 20 65 61 63 68 20 5c | 68 79 70 65 72 7b 69 6e |e each \|hyper{in|
|00004620| 69 74 7d 20 77 69 74 68 | 6f 75 74 20 61 73 73 69 |it} with|out assi|
|00004630| 67 6e 69 6e 67 20 6f 72 | 20 72 65 66 65 72 72 69 |gning or| referri|
|00004640| 6e 67 20 74 6f 20 74 68 | 65 20 76 61 6c 75 65 20 |ng to th|e value |
|00004650| 6f 66 20 61 6e 79 0a 5c | 68 79 70 65 72 7b 76 61 |of any.\|hyper{va|
|00004660| 72 69 61 62 6c 65 7d 2e | 20 20 49 66 20 74 68 69 |riable}.| If thi|
|00004670| 73 20 72 65 73 74 72 69 | 63 74 69 6f 6e 20 69 73 |s restri|ction is|
|00004680| 20 76 69 6f 6c 61 74 65 | 64 2c 20 74 68 65 6e 20 | violate|d, then |
|00004690| 69 74 20 69 73 20 61 6e | 20 65 72 72 6f 72 2e 20 |it is an| error. |
|000046a0| 20 54 68 65 0a 72 65 73 | 74 72 69 63 74 69 6f 6e | The.res|triction|
|000046b0| 20 69 73 20 6e 65 63 65 | 73 73 61 72 79 20 62 65 | is nece|ssary be|
|000046c0| 63 61 75 73 65 20 53 63 | 68 65 6d 65 20 70 61 73 |cause Sc|heme pas|
|000046d0| 73 65 73 20 61 72 67 75 | 6d 65 6e 74 73 20 62 79 |ses argu|ments by|
|000046e0| 20 76 61 6c 75 65 20 72 | 61 74 68 65 72 20 74 68 | value r|ather th|
|000046f0| 61 6e 20 62 79 0a 6e 61 | 6d 65 2e 20 20 49 6e 20 |an by.na|me. In |
|00004700| 74 68 65 20 6d 6f 73 74 | 20 63 6f 6d 6d 6f 6e 20 |the most| common |
|00004710| 75 73 65 73 20 6f 66 20 | 5c 69 64 65 7b 6c 65 74 |uses of |\ide{let|
|00004720| 72 65 63 7d 2c 20 61 6c | 6c 20 74 68 65 20 5c 68 |rec}, al|l the \h|
|00004730| 79 70 65 72 7b 69 6e 69 | 74 7d 73 20 61 72 65 0a |yper{ini|t}s are.|
|00004740| 5c 6c 61 6d 62 64 61 65 | 78 70 7b 7d 73 20 61 6e |\lambdae|xp{}s an|
|00004750| 64 20 74 68 65 20 72 65 | 73 74 72 69 63 74 69 6f |d the re|strictio|
|00004760| 6e 20 69 73 20 73 61 74 | 69 73 66 69 65 64 20 61 |n is sat|isfied a|
|00004770| 75 74 6f 6d 61 74 69 63 | 61 6c 6c 79 2e 0a 0a 25 |utomatic|ally...%|
|00004780| 20 5c 74 6f 64 6f 7b 75 | 73 65 20 6f 72 20 75 73 | \todo{u|se or us|
|00004790| 65 73 3f 20 20 2d 2d 2d | 20 4a 69 6e 78 2e 7d 0a |es? ---| Jinx.}.|
|000047a0| 0a 5c 65 6e 64 7b 65 6e | 74 72 79 7d 0a 0a 0a 5c |.\end{en|try}...\|
|000047b0| 73 75 62 73 65 63 74 69 | 6f 6e 7b 53 65 71 75 65 |subsecti|on{Seque|
|000047c0| 6e 63 69 6e 67 7d 5c 75 | 6e 73 65 63 74 69 6f 6e |ncing}\u|nsection|
|000047d0| 0a 0a 5c 62 65 67 69 6e | 7b 65 6e 74 72 79 7d 7b |..\begin|{entry}{|
|000047e0| 25 0a 5c 70 72 6f 74 6f | 7b 62 65 67 69 6e 7d 7b |%.\proto|{begin}{|
|000047f0| 20 5c 68 79 70 65 72 69 | 7b 65 78 70 72 65 73 73 | \hyperi|{express|
|00004800| 69 6f 6e 7d 20 5c 68 79 | 70 65 72 69 69 7b 65 78 |ion} \hy|perii{ex|
|00004810| 70 72 65 73 73 69 6f 6e | 7d 20 5c 64 6f 74 73 66 |pression|} \dotsf|
|00004820| 6f 6f 7d 7b 65 73 73 65 | 6e 74 69 61 6c 20 5c 65 |oo}{esse|ntial \e|
|00004830| 78 70 72 74 79 70 65 7d | 7d 0a 0a 54 68 65 20 5c |xprtype}|}..The \|
|00004840| 68 79 70 65 72 7b 65 78 | 70 72 65 73 73 69 6f 6e |hyper{ex|pression|
|00004850| 7d 73 20 61 72 65 20 65 | 76 61 6c 75 61 74 65 64 |}s are e|valuated|
|00004860| 20 73 65 71 75 65 6e 74 | 69 61 6c 6c 79 20 66 72 | sequent|ially fr|
|00004870| 6f 6d 20 6c 65 66 74 20 | 74 6f 20 72 69 67 68 74 |om left |to right|
|00004880| 2c 0a 61 6e 64 20 74 68 | 65 20 76 61 6c 75 65 20 |,.and th|e value |
|00004890| 6f 66 20 74 68 65 20 6c | 61 73 74 20 5c 68 79 70 |of the l|ast \hyp|
|000048a0| 65 72 7b 65 78 70 72 65 | 73 73 69 6f 6e 7d 20 69 |er{expre|ssion} i|
|000048b0| 73 20 72 65 74 75 72 6e | 65 64 2e 20 20 54 68 69 |s return|ed. Thi|
|000048c0| 73 0a 65 78 70 72 65 73 | 73 69 6f 6e 20 74 79 70 |s.expres|sion typ|
|000048d0| 65 20 69 73 20 75 73 65 | 64 20 74 6f 20 73 65 71 |e is use|d to seq|
|000048e0| 75 65 6e 63 65 20 73 69 | 64 65 20 65 66 66 65 63 |uence si|de effec|
|000048f0| 74 73 20 73 75 63 68 20 | 61 73 20 69 6e 70 75 74 |ts such |as input|
|00004900| 20 61 6e 64 0a 6f 75 74 | 70 75 74 2e 0a 0a 5c 62 | and.out|put...\b|
|00004910| 65 67 69 6e 7b 73 63 68 | 65 6d 65 7d 0a 28 62 65 |egin{sch|eme}.(be|
|00004920| 67 69 6e 20 28 73 65 74 | 21 20 78 20 35 29 0a 20 |gin (set|! x 5). |
|00004930| 20 20 20 20 20 20 28 2b | 20 78 20 31 29 29 20 20 | (+| x 1)) |
|00004940| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004950| 5c 65 76 20 20 36 0a 0a | 28 62 65 67 69 6e 20 28 |\ev 6..|(begin (|
|00004960| 64 69 73 70 6c 61 79 20 | 22 34 20 70 6c 75 73 20 |display |"4 plus |
|00004970| 31 20 65 71 75 61 6c 73 | 20 22 29 0a 20 20 20 20 |1 equals| "). |
|00004980| 20 20 20 28 64 69 73 70 | 6c 61 79 20 28 2b 20 34 | (disp|lay (+ 4|
|00004990| 20 31 29 29 29 20 20 20 | 20 20 20 5c 65 76 20 20 | 1))) | \ev |
|000049a0| 5c 75 6e 73 70 65 63 69 | 66 69 65 64 0a 20 5c 3e |\unspeci|fied. \>|
|000049b0| 7b 5c 65 6d 20 61 6e 64 | 20 70 72 69 6e 74 73 7d |{\em and| prints}|
|000049c0| 20 20 34 20 70 6c 75 73 | 20 31 20 65 71 75 61 6c | 4 plus| 1 equal|
|000049d0| 73 20 35 25 0a 5c 65 6e | 64 7b 73 63 68 65 6d 65 |s 5%.\en|d{scheme|
|000049e0| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 6e 6f 74 65 7d 0a |}..\begi|n{note}.|
|000049f0| 5c 63 69 74 65 7b 53 49 | 43 50 7d 20 75 73 65 73 |\cite{SI|CP} uses|
|00004a00| 20 74 68 65 20 6b 65 79 | 77 6f 72 64 20 5c 69 64 | the key|word \id|
|00004a10| 65 7b 73 65 71 75 65 6e | 63 65 7d 20 69 6e 73 74 |e{sequen|ce} inst|
|00004a20| 65 61 64 20 6f 66 20 5c | 69 64 65 7b 62 65 67 69 |ead of \|ide{begi|
|00004a30| 6e 7d 2e 0a 5c 65 6e 64 | 7b 6e 6f 74 65 7d 0a 0a |n}..\end|{note}..|
|00004a40| 5c 65 6e 64 7b 65 6e 74 | 72 79 7d 0a 0a 0a 5c 73 |\end{ent|ry}...\s|
|00004a50| 75 62 73 65 63 74 69 6f | 6e 7b 49 74 65 72 61 74 |ubsectio|n{Iterat|
|00004a60| 69 6f 6e 7d 25 5c 75 6e | 73 65 63 74 69 6f 6e 0a |ion}%\un|section.|
|00004a70| 0a 5c 6e 6f 69 6e 64 65 | 6e 74 25 0a 5c 70 70 72 |.\noinde|nt%.\ppr|
|00004a80| 6f 74 6f 7b 28 64 6f 20 | 28 28 5c 68 79 70 65 72 |oto{(do |((\hyper|
|00004a90| 69 7b 76 61 72 69 61 62 | 6c 65 7d 20 5c 68 79 70 |i{variab|le} \hyp|
|00004aa0| 65 72 69 7b 69 6e 69 74 | 7d 20 5c 68 79 70 65 72 |eri{init|} \hyper|
|00004ab0| 69 7b 73 74 65 70 7d 29 | 7d 7b 5c 65 78 70 72 74 |i{step})|}{\exprt|
|00004ac0| 79 70 65 7d 0a 5c 6d 61 | 69 6e 73 63 68 69 6e 64 |ype}.\ma|inschind|
|00004ad0| 65 78 7b 64 6f 7d 7b 5c | 74 74 5c 6f 62 65 79 73 |ex{do}{\|tt\obeys|
|00004ae0| 70 61 63 65 73 25 0a 20 | 20 20 20 20 5c 64 6f 74 |paces%. | \dot|
|00004af0| 73 66 6f 6f 29 5c 5c 0a | 20 20 20 20 28 5c 68 79 |sfoo)\\.| (\hy|
|00004b00| 70 65 72 7b 74 65 73 74 | 7d 20 5c 68 79 70 65 72 |per{test|} \hyper|
|00004b10| 7b 65 78 70 72 65 73 73 | 69 6f 6e 7d 20 5c 64 6f |{express|ion} \do|
|00004b20| 74 73 66 6f 6f 29 5c 5c | 0a 20 20 5c 68 79 70 65 |tsfoo)\\|. \hype|
|00004b30| 72 7b 63 6f 6d 6d 61 6e | 64 7d 20 5c 64 6f 74 73 |r{comman|d} \dots|
|00004b40| 66 6f 6f 29 7d 0a 0a 5c | 69 64 65 7b 44 6f 7d 20 |foo)}..\|ide{Do} |
|00004b50| 69 73 20 61 6e 20 69 74 | 65 72 61 74 69 6f 6e 20 |is an it|eration |
|00004b60| 63 6f 6e 73 74 72 75 63 | 74 2e 20 20 49 74 20 73 |construc|t. It s|
|00004b70| 70 65 63 69 66 69 65 73 | 20 61 20 73 65 74 20 6f |pecifies| a set o|
|00004b80| 66 20 76 61 72 69 61 62 | 6c 65 73 20 74 6f 0a 62 |f variab|les to.b|
|00004b90| 65 20 62 6f 75 6e 64 2c | 20 68 6f 77 20 74 68 65 |e bound,| how the|
|00004ba0| 79 20 61 72 65 20 74 6f | 20 62 65 20 69 6e 69 74 |y are to| be init|
|00004bb0| 69 61 6c 69 7a 65 64 20 | 61 74 20 74 68 65 20 73 |ialized |at the s|
|00004bc0| 74 61 72 74 2c 20 61 6e | 64 20 68 6f 77 20 74 68 |tart, an|d how th|
|00004bd0| 65 79 20 61 72 65 0a 74 | 6f 20 62 65 20 75 70 64 |ey are.t|o be upd|
|00004be0| 61 74 65 64 20 6f 6e 20 | 65 61 63 68 20 69 74 65 |ated on |each ite|
|00004bf0| 72 61 74 69 6f 6e 2e 20 | 20 57 68 65 6e 20 61 20 |ration. | When a |
|00004c00| 74 65 72 6d 69 6e 61 74 | 69 6f 6e 20 63 6f 6e 64 |terminat|ion cond|
|00004c10| 69 74 69 6f 6e 20 69 73 | 20 6d 65 74 2c 0a 74 68 |ition is| met,.th|
|00004c20| 65 20 6c 6f 6f 70 20 65 | 78 69 74 73 20 77 69 74 |e loop e|xits wit|
|00004c30| 68 20 61 20 73 70 65 63 | 69 66 69 65 64 20 72 65 |h a spec|ified re|
|00004c40| 73 75 6c 74 20 76 61 6c | 75 65 2e 0a 0a 5c 69 64 |sult val|ue...\id|
|00004c50| 65 7b 44 6f 7d 20 65 78 | 70 72 65 73 73 69 6f 6e |e{Do} ex|pression|
|00004c60| 73 20 61 72 65 20 65 76 | 61 6c 75 61 74 65 64 20 |s are ev|aluated |
|00004c70| 61 73 20 66 6f 6c 6c 6f | 77 73 3a 0a 54 68 65 20 |as follo|ws:.The |
|00004c80| 5c 68 79 70 65 72 7b 69 | 6e 69 74 7d 20 65 78 70 |\hyper{i|nit} exp|
|00004c90| 72 65 73 73 69 6f 6e 73 | 20 61 72 65 20 65 76 61 |ressions| are eva|
|00004ca0| 6c 75 61 74 65 64 20 28 | 69 6e 20 73 6f 6d 65 20 |luated (|in some |
|00004cb0| 75 6e 73 70 65 63 69 66 | 69 65 64 20 6f 72 64 65 |unspecif|ied orde|
|00004cc0| 72 29 2c 0a 74 68 65 20 | 5c 68 79 70 65 72 7b 76 |r),.the |\hyper{v|
|00004cd0| 61 72 69 61 62 6c 65 7d | 73 20 61 72 65 20 62 6f |ariable}|s are bo|
|00004ce0| 75 6e 64 20 74 6f 20 66 | 72 65 73 68 20 6c 6f 63 |und to f|resh loc|
|00004cf0| 61 74 69 6f 6e 73 2c 20 | 74 68 65 20 72 65 73 75 |ations, |the resu|
|00004d00| 6c 74 73 20 6f 66 20 74 | 68 65 0a 5c 68 79 70 65 |lts of t|he.\hype|
|00004d10| 72 7b 69 6e 69 74 7d 20 | 65 78 70 72 65 73 73 69 |r{init} |expressi|
|00004d20| 6f 6e 73 20 61 72 65 20 | 73 74 6f 72 65 64 20 69 |ons are |stored i|
|00004d30| 6e 20 74 68 65 20 62 69 | 6e 64 69 6e 67 73 20 6f |n the bi|ndings o|
|00004d40| 66 20 74 68 65 0a 5c 68 | 79 70 65 72 7b 76 61 72 |f the.\h|yper{var|
|00004d50| 69 61 62 6c 65 7d 73 2c | 20 61 6e 64 20 74 68 65 |iable}s,| and the|
|00004d60| 6e 20 74 68 65 20 69 74 | 65 72 61 74 69 6f 6e 20 |n the it|eration |
|00004d70| 70 68 61 73 65 20 62 65 | 67 69 6e 73 2e 0a 0a 5c |phase be|gins...\|
|00004d80| 76 65 73 74 20 45 61 63 | 68 20 69 74 65 72 61 74 |vest Eac|h iterat|
|00004d90| 69 6f 6e 20 62 65 67 69 | 6e 73 20 62 79 20 65 76 |ion begi|ns by ev|
|00004da0| 61 6c 75 61 74 69 6e 67 | 20 5c 68 79 70 65 72 7b |aluating| \hyper{|
|00004db0| 74 65 73 74 7d 3b 20 69 | 66 20 74 68 65 20 72 65 |test}; i|f the re|
|00004dc0| 73 75 6c 74 20 69 73 0a | 66 61 6c 73 65 20 28 73 |sult is.|false (s|
|00004dd0| 65 65 20 73 65 63 74 69 | 6f 6e 7e 5c 72 65 66 7b |ee secti|on~\ref{|
|00004de0| 62 6f 6f 6c 65 61 6e 73 | 65 63 74 69 6f 6e 7d 29 |booleans|ection})|
|00004df0| 2c 20 74 68 65 6e 20 74 | 68 65 20 5c 68 79 70 65 |, then t|he \hype|
|00004e00| 72 7b 63 6f 6d 6d 61 6e | 64 7d 0a 65 78 70 72 65 |r{comman|d}.expre|
|00004e10| 73 73 69 6f 6e 73 20 61 | 72 65 20 65 76 61 6c 75 |ssions a|re evalu|
|00004e20| 61 74 65 64 20 69 6e 20 | 6f 72 64 65 72 20 66 6f |ated in |order fo|
|00004e30| 72 20 65 66 66 65 63 74 | 2c 20 74 68 65 20 5c 68 |r effect|, the \h|
|00004e40| 79 70 65 72 7b 73 74 65 | 70 7d 0a 65 78 70 72 65 |yper{ste|p}.expre|
|00004e50| 73 73 69 6f 6e 73 20 61 | 72 65 20 65 76 61 6c 75 |ssions a|re evalu|
|00004e60| 61 74 65 64 20 69 6e 20 | 73 6f 6d 65 20 75 6e 73 |ated in |some uns|
|00004e70| 70 65 63 69 66 69 65 64 | 20 6f 72 64 65 72 2c 20 |pecified| order, |
|00004e80| 74 68 65 0a 5c 68 79 70 | 65 72 7b 76 61 72 69 61 |the.\hyp|er{varia|
|00004e90| 62 6c 65 7d 73 20 61 72 | 65 20 62 6f 75 6e 64 20 |ble}s ar|e bound |
|00004ea0| 74 6f 20 66 72 65 73 68 | 20 6c 6f 63 61 74 69 6f |to fresh| locatio|
|00004eb0| 6e 73 2c 20 74 68 65 20 | 72 65 73 75 6c 74 73 20 |ns, the |results |
|00004ec0| 6f 66 20 74 68 65 0a 5c | 68 79 70 65 72 7b 73 74 |of the.\|hyper{st|
|00004ed0| 65 70 7d 73 20 61 72 65 | 20 73 74 6f 72 65 64 20 |ep}s are| stored |
|00004ee0| 69 6e 20 74 68 65 20 62 | 69 6e 64 69 6e 67 73 20 |in the b|indings |
|00004ef0| 6f 66 20 74 68 65 0a 5c | 68 79 70 65 72 7b 76 61 |of the.\|hyper{va|
|00004f00| 72 69 61 62 6c 65 7d 73 | 2c 20 61 6e 64 20 74 68 |riable}s|, and th|
|00004f10| 65 20 6e 65 78 74 20 69 | 74 65 72 61 74 69 6f 6e |e next i|teration|
|00004f20| 20 62 65 67 69 6e 73 2e | 0a 0a 5c 76 65 73 74 20 | begins.|..\vest |
|00004f30| 49 66 20 5c 68 79 70 65 | 72 7b 74 65 73 74 7d 20 |If \hype|r{test} |
|00004f40| 65 76 61 6c 75 61 74 65 | 73 20 74 6f 20 61 20 74 |evaluate|s to a t|
|00004f50| 72 75 65 20 76 61 6c 75 | 65 2c 20 74 68 65 6e 20 |rue valu|e, then |
|00004f60| 74 68 65 0a 5c 68 79 70 | 65 72 7b 65 78 70 72 65 |the.\hyp|er{expre|
|00004f70| 73 73 69 6f 6e 7d 73 20 | 61 72 65 20 65 76 61 6c |ssion}s |are eval|
|00004f80| 75 61 74 65 64 20 66 72 | 6f 6d 20 6c 65 66 74 20 |uated fr|om left |
|00004f90| 74 6f 20 72 69 67 68 74 | 20 61 6e 64 20 74 68 65 |to right| and the|
|00004fa0| 20 76 61 6c 75 65 20 6f | 66 0a 74 68 65 20 6c 61 | value o|f.the la|
|00004fb0| 73 74 20 5c 68 79 70 65 | 72 7b 65 78 70 72 65 73 |st \hype|r{expres|
|00004fc0| 73 69 6f 6e 7d 20 69 73 | 20 72 65 74 75 72 6e 65 |sion} is| returne|
|00004fd0| 64 20 61 73 20 74 68 65 | 20 76 61 6c 75 65 20 6f |d as the| value o|
|00004fe0| 66 20 74 68 65 20 5c 69 | 64 65 7b 64 6f 7d 0a 65 |f the \i|de{do}.e|
|00004ff0| 78 70 72 65 73 73 69 6f | 6e 2e 20 20 49 66 20 6e |xpressio|n. If n|
|00005000| 6f 20 5c 68 79 70 65 72 | 7b 65 78 70 72 65 73 73 |o \hyper|{express|
|00005010| 69 6f 6e 7d 73 20 61 72 | 65 20 70 72 65 73 65 6e |ion}s ar|e presen|
|00005020| 74 2c 20 74 68 65 6e 20 | 74 68 65 20 76 61 6c 75 |t, then |the valu|
|00005030| 65 20 6f 66 0a 74 68 65 | 20 5c 69 64 65 7b 64 6f |e of.the| \ide{do|
|00005040| 7d 20 65 78 70 72 65 73 | 73 69 6f 6e 20 69 73 20 |} expres|sion is |
|00005050| 75 6e 73 70 65 63 69 66 | 69 65 64 2e 0a 0a 5c 76 |unspecif|ied...\v|
|00005060| 65 73 74 20 54 68 65 20 | 72 65 67 69 6f 6e 5c 69 |est The |region\i|
|00005070| 6e 64 65 78 7b 72 65 67 | 69 6f 6e 7d 20 6f 66 20 |ndex{reg|ion} of |
|00005080| 74 68 65 20 62 69 6e 64 | 69 6e 67 20 6f 66 20 61 |the bind|ing of a|
|00005090| 20 5c 68 79 70 65 72 7b | 76 61 72 69 61 62 6c 65 | \hyper{|variable|
|000050a0| 7d 0a 63 6f 6e 73 69 73 | 74 73 20 6f 66 20 74 68 |}.consis|ts of th|
|000050b0| 65 20 65 6e 74 69 72 65 | 20 5c 69 64 65 7b 64 6f |e entire| \ide{do|
|000050c0| 7d 20 65 78 70 72 65 73 | 73 69 6f 6e 20 65 78 63 |} expres|sion exc|
|000050d0| 65 70 74 20 66 6f 72 20 | 74 68 65 20 5c 68 79 70 |ept for |the \hyp|
|000050e0| 65 72 7b 69 6e 69 74 7d | 73 2e 0a 49 74 20 69 73 |er{init}|s..It is|
|000050f0| 20 61 6e 20 65 72 72 6f | 72 20 66 6f 72 20 61 20 | an erro|r for a |
|00005100| 5c 68 79 70 65 72 7b 76 | 61 72 69 61 62 6c 65 7d |\hyper{v|ariable}|
|00005110| 20 74 6f 20 61 70 70 65 | 61 72 20 6d 6f 72 65 20 | to appe|ar more |
|00005120| 74 68 61 6e 20 6f 6e 63 | 65 20 69 6e 20 74 68 65 |than onc|e in the|
|00005130| 0a 6c 69 73 74 20 6f 66 | 20 5c 69 64 65 7b 64 6f |.list of| \ide{do|
|00005140| 7d 20 76 61 72 69 61 62 | 6c 65 73 2e 0a 0a 5c 76 |} variab|les...\v|
|00005150| 65 73 74 20 41 20 5c 68 | 79 70 65 72 7b 73 74 65 |est A \h|yper{ste|
|00005160| 70 7d 20 6d 61 79 20 62 | 65 20 6f 6d 69 74 74 65 |p} may b|e omitte|
|00005170| 64 2c 20 69 6e 20 77 68 | 69 63 68 20 63 61 73 65 |d, in wh|ich case|
|00005180| 20 74 68 65 20 65 66 66 | 65 63 74 20 69 73 20 74 | the eff|ect is t|
|00005190| 68 65 0a 73 61 6d 65 20 | 61 73 20 69 66 20 7b 5c |he.same |as if {\|
|000051a0| 63 66 28 5c 68 79 70 65 | 72 7b 76 61 72 69 61 62 |cf(\hype|r{variab|
|000051b0| 6c 65 7d 20 5c 68 79 70 | 65 72 7b 69 6e 69 74 7d |le} \hyp|er{init}|
|000051c0| 20 5c 68 79 70 65 72 7b | 76 61 72 69 61 62 6c 65 | \hyper{|variable|
|000051d0| 7d 29 7d 20 68 61 64 0a | 62 65 65 6e 20 77 72 69 |})} had.|been wri|
|000051e0| 74 74 65 6e 20 69 6e 73 | 74 65 61 64 20 6f 66 20 |tten ins|tead of |
|000051f0| 7b 5c 63 66 28 5c 68 79 | 70 65 72 7b 76 61 72 69 |{\cf(\hy|per{vari|
|00005200| 61 62 6c 65 7d 20 5c 68 | 79 70 65 72 7b 69 6e 69 |able} \h|yper{ini|
|00005210| 74 7d 29 7d 2e 0a 0a 5c | 62 65 67 69 6e 7b 73 63 |t})}...\|begin{sc|
|00005220| 68 65 6d 65 7d 0a 28 64 | 6f 20 28 28 76 65 63 20 |heme}.(d|o ((vec |
|00005230| 28 6d 61 6b 65 2d 76 65 | 63 74 6f 72 20 35 29 29 |(make-ve|ctor 5))|
|00005240| 0a 20 20 20 20 20 28 69 | 20 30 20 28 2b 20 69 20 |. (i| 0 (+ i |
|00005250| 31 29 29 29 0a 20 20 20 | 20 28 28 3d 20 69 20 35 |1))). | ((= i 5|
|00005260| 29 20 76 65 63 29 0a 20 | 20 28 76 65 63 74 6f 72 |) vec). | (vector|
|00005270| 2d 73 65 74 21 20 76 65 | 63 20 69 20 69 29 29 20 |-set! ve|c i i)) |
|00005280| 20 20 20 20 20 20 20 20 | 20 5c 65 76 20 20 5c 23 | | \ev \#|
|00005290| 28 30 20 31 20 32 20 33 | 20 34 29 0a 0a 28 6c 65 |(0 1 2 3| 4)..(le|
|000052a0| 74 20 28 28 78 20 27 28 | 31 20 33 20 35 20 37 20 |t ((x '(|1 3 5 7 |
|000052b0| 39 29 29 29 0a 20 20 28 | 64 6f 20 28 28 78 20 78 |9))). (|do ((x x|
|000052c0| 20 28 63 64 72 20 78 29 | 29 0a 20 20 20 20 20 20 | (cdr x)|). |
|000052d0| 20 28 73 75 6d 20 30 20 | 28 2b 20 73 75 6d 20 28 | (sum 0 |(+ sum (|
|000052e0| 63 61 72 20 78 29 29 29 | 29 0a 20 20 20 20 20 20 |car x)))|). |
|000052f0| 28 28 6e 75 6c 6c 3f 20 | 78 29 20 73 75 6d 29 29 |((null? |x) sum))|
|00005300| 29 20 20 20 20 20 20 20 | 20 20 20 20 20 20 5c 65 |) | \e|
|00005310| 76 20 20 32 35 25 0a 5c | 65 6e 64 7b 73 63 68 65 |v 25%.\|end{sche|
|00005320| 6d 65 7d 0a 0a 25 5c 65 | 6e 64 7b 65 6e 74 72 79 |me}..%\e|nd{entry|
|00005330| 7d 0a 0a 0a 5c 62 65 67 | 69 6e 7b 65 6e 74 72 79 |}...\beg|in{entry|
|00005340| 7d 7b 25 0a 5c 70 72 6f | 74 6f 7b 6c 65 74 7d 7b |}{%.\pro|to{let}{|
|00005350| 20 5c 68 79 70 65 72 7b | 76 61 72 69 61 62 6c 65 | \hyper{|variable|
|00005360| 7d 20 5c 68 79 70 65 72 | 7b 62 69 6e 64 69 6e 67 |} \hyper|{binding|
|00005370| 73 7d 20 5c 68 79 70 65 | 72 7b 62 6f 64 79 7d 7d |s} \hype|r{body}}|
|00005380| 7b 5c 65 78 70 72 74 79 | 70 65 7d 7d 0a 0a 5c 6c |{\exprty|pe}}..\l|
|00005390| 61 62 65 6c 7b 6e 61 6d | 65 64 6c 65 74 7d 0a 53 |abel{nam|edlet}.S|
|000053a0| 6f 6d 65 20 69 6d 70 6c | 65 6d 65 6e 74 61 74 69 |ome impl|ementati|
|000053b0| 6f 6e 73 20 6f 66 20 53 | 63 68 65 6d 65 20 70 65 |ons of S|cheme pe|
|000053c0| 72 6d 69 74 20 61 20 76 | 61 72 69 61 6e 74 20 6f |rmit a v|ariant o|
|000053d0| 6e 20 74 68 65 20 73 79 | 6e 74 61 78 20 6f 66 0a |n the sy|ntax of.|
|000053e0| 5c 69 64 65 7b 6c 65 74 | 7d 20 63 61 6c 6c 65 64 |\ide{let|} called|
|000053f0| 20 60 60 6e 61 6d 65 64 | 20 5c 69 64 65 7b 6c 65 | ``named| \ide{le|
|00005400| 74 7d 27 27 20 77 68 69 | 63 68 20 70 72 6f 76 69 |t}'' whi|ch provi|
|00005410| 64 65 73 20 61 20 6d 6f | 72 65 20 67 65 6e 65 72 |des a mo|re gener|
|00005420| 61 6c 0a 6c 6f 6f 70 69 | 6e 67 20 63 6f 6e 73 74 |al.loopi|ng const|
|00005430| 72 75 63 74 20 74 68 61 | 6e 20 5c 69 64 65 7b 64 |ruct tha|n \ide{d|
|00005440| 6f 7d 2c 20 61 6e 64 20 | 6d 61 79 20 61 6c 73 6f |o}, and |may also|
|00005450| 20 62 65 20 75 73 65 64 | 20 74 6f 20 65 78 70 72 | be used| to expr|
|00005460| 65 73 73 0a 72 65 63 75 | 72 73 69 6f 6e 73 2e 0a |ess.recu|rsions..|
|00005470| 0a 4e 61 6d 65 64 20 5c | 69 64 65 7b 6c 65 74 7d |.Named \|ide{let}|
|00005480| 20 68 61 73 20 74 68 65 | 20 73 61 6d 65 20 73 79 | has the| same sy|
|00005490| 6e 74 61 78 20 61 6e 64 | 20 73 65 6d 61 6e 74 69 |ntax and| semanti|
|000054a0| 63 73 20 61 73 20 6f 72 | 64 69 6e 61 72 79 20 5c |cs as or|dinary \|
|000054b0| 69 64 65 7b 6c 65 74 7d | 0a 65 78 63 65 70 74 20 |ide{let}|.except |
|000054c0| 74 68 61 74 20 5c 68 79 | 70 65 72 7b 76 61 72 69 |that \hy|per{vari|
|000054d0| 61 62 6c 65 7d 20 69 73 | 20 62 6f 75 6e 64 20 77 |able} is| bound w|
|000054e0| 69 74 68 69 6e 20 5c 68 | 79 70 65 72 7b 62 6f 64 |ithin \h|yper{bod|
|000054f0| 79 7d 20 74 6f 20 61 20 | 70 72 6f 63 65 64 75 72 |y} to a |procedur|
|00005500| 65 0a 77 68 6f 73 65 20 | 66 6f 72 6d 61 6c 20 61 |e.whose |formal a|
|00005510| 72 67 75 6d 65 6e 74 73 | 20 61 72 65 20 74 68 65 |rguments| are the|
|00005520| 20 62 6f 75 6e 64 20 76 | 61 72 69 61 62 6c 65 73 | bound v|ariables|
|00005530| 20 61 6e 64 20 77 68 6f | 73 65 20 62 6f 64 79 20 | and who|se body |
|00005540| 69 73 0a 5c 68 79 70 65 | 72 7b 62 6f 64 79 7d 2e |is.\hype|r{body}.|
|00005550| 20 20 54 68 75 73 20 74 | 68 65 20 65 78 65 63 75 | Thus t|he execu|
|00005560| 74 69 6f 6e 20 6f 66 20 | 5c 68 79 70 65 72 7b 62 |tion of |\hyper{b|
|00005570| 6f 64 79 7d 20 6d 61 79 | 20 62 65 20 72 65 70 65 |ody} may| be repe|
|00005580| 61 74 65 64 20 62 79 0a | 69 6e 76 6f 6b 69 6e 67 |ated by.|invoking|
|00005590| 20 74 68 65 20 70 72 6f | 63 65 64 75 72 65 20 6e | the pro|cedure n|
|000055a0| 61 6d 65 64 20 62 79 20 | 5c 68 79 70 65 72 7b 76 |amed by |\hyper{v|
|000055b0| 61 72 69 61 62 6c 65 7d | 2e 0a 0a 25 20 20 20 20 |ariable}|...% |
|000055c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000055d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000055e0| 20 20 20 20 20 20 20 20 | 20 20 7c 20 20 3c 2d 2d | | | <--|
|000055f0| 20 72 69 67 68 74 20 6d | 61 72 67 69 6e 0a 5c 62 | right m|argin.\b|
|00005600| 65 67 69 6e 7b 73 63 68 | 65 6d 65 7d 0a 28 6c 65 |egin{sch|eme}.(le|
|00005610| 74 20 6c 6f 6f 70 20 28 | 28 6e 75 6d 62 65 72 73 |t loop (|(numbers|
|00005620| 20 27 28 33 20 2d 32 20 | 31 20 36 20 2d 35 29 29 | '(3 -2 |1 6 -5))|
|00005630| 0a 20 20 20 20 20 20 20 | 20 20 20 20 28 6e 6f 6e |. | (non|
|00005640| 6e 65 67 20 27 28 29 29 | 0a 20 20 20 20 20 20 20 |neg '())|. |
|00005650| 20 20 20 20 28 6e 65 67 | 20 27 28 29 29 29 0a 20 | (neg| '())). |
|00005660| 20 28 63 6f 6e 64 20 28 | 28 6e 75 6c 6c 3f 20 6e | (cond (|(null? n|
|00005670| 75 6d 62 65 72 73 29 20 | 28 6c 69 73 74 20 6e 6f |umbers) |(list no|
|00005680| 6e 6e 65 67 20 6e 65 67 | 29 29 0a 20 20 20 20 20 |nneg neg|)). |
|00005690| 20 20 20 28 28 3e 3d 20 | 28 63 61 72 20 6e 75 6d | ((>= |(car num|
|000056a0| 62 65 72 73 29 20 30 29 | 0a 20 20 20 20 20 20 20 |bers) 0)|. |
|000056b0| 20 20 28 6c 6f 6f 70 20 | 28 63 64 72 20 6e 75 6d | (loop |(cdr num|
|000056c0| 62 65 72 73 29 0a 20 20 | 20 20 20 20 20 20 20 20 |bers). | |
|000056d0| 20 20 20 20 20 28 63 6f | 6e 73 20 28 63 61 72 20 | (co|ns (car |
|000056e0| 6e 75 6d 62 65 72 73 29 | 20 6e 6f 6e 6e 65 67 29 |numbers)| nonneg)|
|000056f0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00005700| 6e 65 67 29 29 0a 20 20 | 20 20 20 20 20 20 28 28 |neg)). | ((|
|00005710| 3c 20 28 63 61 72 20 6e | 75 6d 62 65 72 73 29 20 |< (car n|umbers) |
|00005720| 30 29 0a 20 20 20 20 20 | 20 20 20 20 28 6c 6f 6f |0). | (loo|
|00005730| 70 20 28 63 64 72 20 6e | 75 6d 62 65 72 73 29 0a |p (cdr n|umbers).|
|00005740| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 6e | | n|
|00005750| 6f 6e 6e 65 67 0a 20 20 | 20 20 20 20 20 20 20 20 |onneg. | |
|00005760| 20 20 20 20 20 28 63 6f | 6e 73 20 28 63 61 72 20 | (co|ns (car |
|00005770| 6e 75 6d 62 65 72 73 29 | 20 6e 65 67 29 29 29 29 |numbers)| neg))))|
|00005780| 29 20 25 0a 20 20 5c 6c | 65 76 20 20 28 28 36 20 |) %. \l|ev ((6 |
|00005790| 31 20 33 29 20 28 2d 35 | 20 2d 32 29 29 25 0a 5c |1 3) (-5| -2))%.\|
|000057a0| 65 6e 64 7b 73 63 68 65 | 6d 65 7d 0a 0a 5c 65 6e |end{sche|me}..\en|
|000057b0| 64 7b 65 6e 74 72 79 7d | 0a 0a 0a 5c 73 75 62 73 |d{entry}|...\subs|
|000057c0| 65 63 74 69 6f 6e 7b 44 | 65 6c 61 79 65 64 20 65 |ection{D|elayed e|
|000057d0| 76 61 6c 75 61 74 69 6f | 6e 7d 5c 75 6e 73 65 63 |valuatio|n}\unsec|
|000057e0| 74 69 6f 6e 0a 5c 6c 61 | 62 65 6c 7b 64 65 6c 61 |tion.\la|bel{dela|
|000057f0| 79 7d 0a 0a 5c 62 65 67 | 69 6e 7b 65 6e 74 72 79 |y}..\beg|in{entry|
|00005800| 7d 7b 25 0a 5c 70 72 6f | 74 6f 7b 64 65 6c 61 79 |}{%.\pro|to{delay|
|00005810| 7d 7b 20 5c 68 79 70 65 | 72 7b 65 78 70 72 65 73 |}{ \hype|r{expres|
|00005820| 73 69 6f 6e 7d 7d 7b 5c | 65 78 70 72 74 79 70 65 |sion}}{\|exprtype|
|00005830| 7d 7d 0a 0a 5c 74 6f 64 | 6f 7b 46 69 78 2e 7d 0a |}}..\tod|o{Fix.}.|
|00005840| 0a 54 68 65 20 5c 69 64 | 65 7b 64 65 6c 61 79 7d |.The \id|e{delay}|
|00005850| 20 63 6f 6e 73 74 72 75 | 63 74 20 69 73 20 75 73 | constru|ct is us|
|00005860| 65 64 20 74 6f 67 65 74 | 68 65 72 20 77 69 74 68 |ed toget|her with|
|00005870| 20 74 68 65 20 70 72 6f | 63 65 64 75 72 65 20 5c | the pro|cedure \|
|00005880| 69 64 65 7b 66 6f 72 63 | 65 7d 20 74 6f 0a 69 6d |ide{forc|e} to.im|
|00005890| 70 6c 65 6d 65 6e 74 20 | 5c 64 65 66 69 6e 69 6e |plement |\definin|
|000058a0| 67 7b 6c 61 7a 79 20 65 | 76 61 6c 75 61 74 69 6f |g{lazy e|valuatio|
|000058b0| 6e 7d 20 6f 72 20 5c 64 | 65 66 69 6e 69 6e 67 7b |n} or \d|efining{|
|000058c0| 63 61 6c 6c 20 62 79 20 | 6e 65 65 64 7d 2e 0a 7b |call by |need}..{|
|000058d0| 5c 74 74 28 64 65 6c 61 | 79 20 5c 68 79 70 65 72 |\tt(dela|y \hyper|
|000058e0| 7b 65 78 70 72 65 73 73 | 69 6f 6e 7d 29 7d 20 72 |{express|ion})} r|
|000058f0| 65 74 75 72 6e 73 20 61 | 6e 20 6f 62 6a 65 63 74 |eturns a|n object|
|00005900| 20 63 61 6c 6c 65 64 20 | 61 0a 5c 64 65 66 69 6e | called |a.\defin|
|00005910| 69 6e 67 7b 70 72 6f 6d | 69 73 65 7d 20 77 68 69 |ing{prom|ise} whi|
|00005920| 63 68 20 61 74 20 73 6f | 6d 65 20 70 6f 69 6e 74 |ch at so|me point|
|00005930| 20 69 6e 20 74 68 65 20 | 66 75 74 75 72 65 20 6d | in the |future m|
|00005940| 61 79 20 62 65 20 61 73 | 6b 65 64 20 28 62 79 0a |ay be as|ked (by.|
|00005950| 74 68 65 20 5c 69 64 65 | 7b 66 6f 72 63 65 7d 20 |the \ide|{force} |
|00005960| 70 72 6f 63 65 64 75 72 | 65 29 20 5c 74 6f 64 6f |procedur|e) \todo|
|00005970| 7b 42 61 72 74 6c 65 79 | 27 73 20 77 68 69 74 65 |{Bartley|'s white|
|00005980| 20 6c 69 65 3b 20 4f 4b | 3f 7d 20 74 6f 20 65 76 | lie; OK|?} to ev|
|00005990| 61 6c 75 61 74 65 0a 5c | 68 79 70 65 72 7b 65 78 |aluate.\|hyper{ex|
|000059a0| 70 72 65 73 73 69 6f 6e | 7d 20 61 6e 64 20 64 65 |pression|} and de|
|000059b0| 6c 69 76 65 72 20 74 68 | 65 20 72 65 73 75 6c 74 |liver th|e result|
|000059c0| 69 6e 67 20 76 61 6c 75 | 65 2e 0a 0a 53 65 65 20 |ing valu|e...See |
|000059d0| 74 68 65 20 64 65 73 63 | 72 69 70 74 69 6f 6e 20 |the desc|ription |
|000059e0| 6f 66 20 5c 69 64 65 7b | 66 6f 72 63 65 7d 20 28 |of \ide{|force} (|
|000059f0| 73 65 63 74 69 6f 6e 7e | 5c 72 65 66 7b 66 6f 72 |section~|\ref{for|
|00005a00| 63 65 7d 29 20 66 6f 72 | 20 61 0a 63 6f 6d 70 6c |ce}) for| a.compl|
|00005a10| 65 74 65 20 64 65 73 63 | 72 69 70 74 69 6f 6e 20 |ete desc|ription |
|00005a20| 6f 66 20 5c 69 64 65 7b | 64 65 6c 61 79 7d 2e 0a |of \ide{|delay}..|
|00005a30| 0a 5c 65 6e 64 7b 65 6e | 74 72 79 7d 0a 0a 0a 5c |.\end{en|try}...\|
|00005a40| 73 75 62 73 65 63 74 69 | 6f 6e 7b 51 75 61 73 69 |subsecti|on{Quasi|
|00005a50| 71 75 6f 74 61 74 69 6f | 6e 7d 5c 75 6e 73 65 63 |quotatio|n}\unsec|
|00005a60| 74 69 6f 6e 0a 0a 5c 62 | 65 67 69 6e 7b 65 6e 74 |tion..\b|egin{ent|
|00005a70| 72 79 7d 7b 25 0a 5c 70 | 72 6f 74 6f 7b 71 75 61 |ry}{%.\p|roto{qua|
|00005a80| 73 69 71 75 6f 74 65 7d | 7b 20 5c 68 79 70 65 72 |siquote}|{ \hyper|
|00005a90| 7b 74 65 6d 70 6c 61 74 | 65 7d 7d 7b 65 73 73 65 |{templat|e}}{esse|
|00005aa0| 6e 74 69 61 6c 20 5c 65 | 78 70 72 74 79 70 65 7d |ntial \e|xprtype}|
|00005ab0| 20 5c 6e 6f 70 61 67 65 | 62 72 65 61 6b 0a 5c 70 | \nopage|break.\p|
|00005ac0| 70 72 6f 74 6f 7b 5c 62 | 61 63 6b 71 75 6f 74 65 |proto{\b|ackquote|
|00005ad0| 5c 68 79 70 65 72 7b 74 | 65 6d 70 6c 61 74 65 7d |\hyper{t|emplate}|
|00005ae0| 7d 7b 65 73 73 65 6e 74 | 69 61 6c 20 5c 65 78 70 |}{essent|ial \exp|
|00005af0| 72 74 79 70 65 7d 7d 0a | 0a 60 60 42 61 63 6b 71 |rtype}}.|.``Backq|
|00005b00| 75 6f 74 65 27 27 20 6f | 72 20 60 60 71 75 61 73 |uote'' o|r ``quas|
|00005b10| 69 71 75 6f 74 65 27 27 | 5c 69 6e 64 65 78 7b 62 |iquote''|\index{b|
|00005b20| 61 63 6b 71 75 6f 74 65 | 7d 20 65 78 70 72 65 73 |ackquote|} expres|
|00005b30| 73 69 6f 6e 73 20 61 72 | 65 20 75 73 65 66 75 6c |sions ar|e useful|
|00005b40| 0a 66 6f 72 20 63 6f 6e | 73 74 72 75 63 74 69 6e |.for con|structin|
|00005b50| 67 20 61 20 6c 69 73 74 | 20 6f 72 20 76 65 63 74 |g a list| or vect|
|00005b60| 6f 72 20 73 74 72 75 63 | 74 75 72 65 20 77 68 65 |or struc|ture whe|
|00005b70| 6e 20 6d 6f 73 74 20 62 | 75 74 20 6e 6f 74 20 61 |n most b|ut not a|
|00005b80| 6c 6c 20 6f 66 20 74 68 | 65 0a 64 65 73 69 72 65 |ll of th|e.desire|
|00005b90| 64 20 73 74 72 75 63 74 | 75 72 65 20 69 73 20 6b |d struct|ure is k|
|00005ba0| 6e 6f 77 6e 20 69 6e 20 | 61 64 76 61 6e 63 65 2e |nown in |advance.|
|00005bb0| 20 20 49 66 20 6e 6f 20 | 63 6f 6d 6d 61 73 5c 69 | If no |commas\i|
|00005bc0| 6e 64 65 78 7b 63 6f 6d | 6d 61 7d 0a 61 70 70 65 |ndex{com|ma}.appe|
|00005bd0| 61 72 20 77 69 74 68 69 | 6e 20 74 68 65 20 5c 68 |ar withi|n the \h|
|00005be0| 79 70 65 72 7b 74 65 6d | 70 6c 61 74 65 7d 2c 20 |yper{tem|plate}, |
|00005bf0| 74 68 65 20 72 65 73 75 | 6c 74 20 6f 66 20 65 76 |the resu|lt of ev|
|00005c00| 61 6c 75 61 74 69 6e 67 | 0a 5c 62 61 63 6b 71 75 |aluating|.\backqu|
|00005c10| 6f 74 65 5c 68 79 70 65 | 72 7b 74 65 6d 70 6c 61 |ote\hype|r{templa|
|00005c20| 74 65 7d 20 69 73 20 65 | 71 75 69 76 61 6c 65 6e |te} is e|quivalen|
|00005c30| 74 20 74 6f 20 74 68 65 | 20 72 65 73 75 6c 74 20 |t to the| result |
|00005c40| 6f 66 20 65 76 61 6c 75 | 61 74 69 6e 67 0a 5c 73 |of evalu|ating.\s|
|00005c50| 69 6e 67 6c 65 71 75 6f | 74 65 5c 68 79 70 65 72 |inglequo|te\hyper|
|00005c60| 7b 74 65 6d 70 6c 61 74 | 65 7d 2e 20 20 49 66 20 |{templat|e}. If |
|00005c70| 61 20 63 6f 6d 6d 61 5c | 6d 61 69 6e 73 63 68 69 |a comma\|mainschi|
|00005c80| 6e 64 65 78 7b 2c 7d 20 | 61 70 70 65 61 72 73 20 |ndex{,} |appears |
|00005c90| 77 69 74 68 69 6e 20 74 | 68 65 0a 5c 68 79 70 65 |within t|he.\hype|
|00005ca0| 72 7b 74 65 6d 70 6c 61 | 74 65 7d 2c 20 68 6f 77 |r{templa|te}, how|
|00005cb0| 65 76 65 72 2c 20 74 68 | 65 20 65 78 70 72 65 73 |ever, th|e expres|
|00005cc0| 73 69 6f 6e 20 66 6f 6c | 6c 6f 77 69 6e 67 20 74 |sion fol|lowing t|
|00005cd0| 68 65 20 63 6f 6d 6d 61 | 20 69 73 0a 65 76 61 6c |he comma| is.eval|
|00005ce0| 75 61 74 65 64 20 28 60 | 60 75 6e 71 75 6f 74 65 |uated (`|`unquote|
|00005cf0| 64 27 27 29 20 61 6e 64 | 20 69 74 73 20 72 65 73 |d'') and| its res|
|00005d00| 75 6c 74 20 69 73 20 69 | 6e 73 65 72 74 65 64 20 |ult is i|nserted |
|00005d10| 69 6e 74 6f 20 74 68 65 | 20 73 74 72 75 63 74 75 |into the| structu|
|00005d20| 72 65 0a 69 6e 73 74 65 | 61 64 20 6f 66 20 74 68 |re.inste|ad of th|
|00005d30| 65 20 63 6f 6d 6d 61 20 | 61 6e 64 20 74 68 65 20 |e comma |and the |
|00005d40| 65 78 70 72 65 73 73 69 | 6f 6e 2e 20 20 49 66 20 |expressi|on. If |
|00005d50| 61 20 63 6f 6d 6d 61 20 | 61 70 70 65 61 72 73 20 |a comma |appears |
|00005d60| 66 6f 6c 6c 6f 77 65 64 | 0a 69 6d 6d 65 64 69 61 |followed|.immedia|
|00005d70| 74 65 6c 79 20 62 79 20 | 61 6e 20 61 74 2d 73 69 |tely by |an at-si|
|00005d80| 67 6e 20 28 5c 61 74 73 | 69 67 6e 29 2c 5c 69 6e |gn (\ats|ign),\in|
|00005d90| 64 65 78 7b 61 74 2d 73 | 69 67 6e 7d 20 74 68 65 |dex{at-s|ign} the|
|00005da0| 6e 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 0a |n the fo|llowing.|
|00005db0| 65 78 70 72 65 73 73 69 | 6f 6e 20 6d 75 73 74 20 |expressi|on must |
|00005dc0| 65 76 61 6c 75 61 74 65 | 20 74 6f 20 61 20 6c 69 |evaluate| to a li|
|00005dd0| 73 74 3b 20 74 68 65 20 | 6f 70 65 6e 69 6e 67 20 |st; the |opening |
|00005de0| 61 6e 64 20 63 6c 6f 73 | 69 6e 67 20 70 61 72 65 |and clos|ing pare|
|00005df0| 6e 74 68 65 73 65 73 0a | 6f 66 20 74 68 65 20 6c |ntheses.|of the l|
|00005e00| 69 73 74 20 61 72 65 20 | 74 68 65 6e 20 60 60 73 |ist are |then ``s|
|00005e10| 74 72 69 70 70 65 64 20 | 61 77 61 79 27 27 20 61 |tripped |away'' a|
|00005e20| 6e 64 20 74 68 65 20 65 | 6c 65 6d 65 6e 74 73 20 |nd the e|lements |
|00005e30| 6f 66 20 74 68 65 20 6c | 69 73 74 20 61 72 65 0a |of the l|ist are.|
|00005e40| 69 6e 73 65 72 74 65 64 | 20 69 6e 20 70 6c 61 63 |inserted| in plac|
|00005e50| 65 20 6f 66 20 74 68 65 | 20 63 6f 6d 6d 61 20 61 |e of the| comma a|
|00005e60| 74 2d 73 69 67 6e 20 65 | 78 70 72 65 73 73 69 6f |t-sign e|xpressio|
|00005e70| 6e 20 73 65 71 75 65 6e | 63 65 2e 0a 0a 25 20 73 |n sequen|ce...% s|
|00005e80| 74 72 75 63 6b 3a 20 22 | 28 69 6e 20 74 68 65 20 |truck: "|(in the |
|00005e90| 73 65 6e 73 65 20 6f 66 | 20 5c 69 64 65 7b 65 71 |sense of| \ide{eq|
|00005ea0| 75 61 6c 3f 7d 29 22 20 | 61 66 74 65 72 20 22 65 |ual?})" |after "e|
|00005eb0| 71 75 69 76 61 6c 65 6e | 74 22 0a 0a 5c 62 65 67 |quivalen|t"..\beg|
|00005ec0| 69 6e 7b 73 63 68 65 6d | 65 7d 0a 60 28 6c 69 73 |in{schem|e}.`(lis|
|00005ed0| 74 20 2c 28 2b 20 31 20 | 32 29 20 34 29 20 20 5c |t ,(+ 1 |2) 4) \|
|00005ee0| 65 76 20 20 28 6c 69 73 | 74 20 33 20 34 29 0a 28 |ev (lis|t 3 4).(|
|00005ef0| 6c 65 74 20 28 28 6e 61 | 6d 65 20 27 61 29 29 20 |let ((na|me 'a)) |
|00005f00| 60 28 6c 69 73 74 20 2c | 6e 61 6d 65 20 27 2c 6e |`(list ,|name ',n|
|00005f10| 61 6d 65 29 29 20 25 0a | 20 20 20 20 20 20 20 20 |ame)) %.| |
|00005f20| 20 20 5c 6c 65 76 20 20 | 28 6c 69 73 74 20 61 20 | \lev |(list a |
|00005f30| 28 71 75 6f 74 65 20 61 | 29 29 0a 60 28 61 20 2c |(quote a|)).`(a ,|
|00005f40| 28 2b 20 31 20 32 29 20 | 2c 40 28 6d 61 70 20 61 |(+ 1 2) |,@(map a|
|00005f50| 62 73 20 27 28 34 20 2d | 35 20 36 29 29 20 62 29 |bs '(4 -|5 6)) b)|
|00005f60| 20 25 0a 20 20 20 20 20 | 20 20 20 20 20 5c 6c 65 | %. | \le|
|00005f70| 76 20 20 28 61 20 33 20 | 34 20 35 20 36 20 62 29 |v (a 3 |4 5 6 b)|
|00005f80| 0a 60 28 28 5c 69 64 65 | 7b 66 6f 6f 7d 20 2c 28 |.`((\ide|{foo} ,(|
|00005f90| 2d 20 31 30 20 33 29 29 | 20 2c 40 28 63 64 72 20 |- 10 3))| ,@(cdr |
|00005fa0| 27 28 63 29 29 20 2e 20 | 2c 28 63 61 72 20 27 28 |'(c)) . |,(car '(|
|00005fb0| 63 6f 6e 73 29 29 29 20 | 25 0a 20 20 20 20 20 20 |cons))) |%. |
|00005fc0| 20 20 20 20 5c 6c 65 76 | 20 20 28 28 66 6f 6f 20 | \lev| ((foo |
|00005fd0| 37 29 20 2e 20 63 6f 6e | 73 29 0a 60 5c 23 28 31 |7) . con|s).`\#(1|
|00005fe0| 30 20 35 20 2c 28 73 71 | 72 74 20 34 29 20 2c 40 |0 5 ,(sq|rt 4) ,@|
|00005ff0| 28 6d 61 70 20 73 71 72 | 74 20 27 28 31 36 20 39 |(map sqr|t '(16 9|
|00006000| 29 29 20 38 29 20 25 0a | 20 20 20 20 20 20 20 20 |)) 8) %.| |
|00006010| 20 20 5c 6c 65 76 20 20 | 5c 23 28 31 30 20 35 20 | \lev |\#(10 5 |
|00006020| 32 20 34 20 33 20 38 29 | 25 0a 5c 65 6e 64 7b 73 |2 4 3 8)|%.\end{s|
|00006030| 63 68 65 6d 65 7d 0a 0a | 51 75 61 73 69 71 75 6f |cheme}..|Quasiquo|
|00006040| 74 65 20 66 6f 72 6d 73 | 20 6d 61 79 20 62 65 20 |te forms| may be |
|00006050| 6e 65 73 74 65 64 2e 20 | 20 53 75 62 73 74 69 74 |nested. | Substit|
|00006060| 75 74 69 6f 6e 73 20 61 | 72 65 20 6d 61 64 65 20 |utions a|re made |
|00006070| 6f 6e 6c 79 20 66 6f 72 | 0a 75 6e 71 75 6f 74 65 |only for|.unquote|
|00006080| 64 20 63 6f 6d 70 6f 6e | 65 6e 74 73 20 61 70 70 |d compon|ents app|
|00006090| 65 61 72 69 6e 67 20 61 | 74 20 74 68 65 20 73 61 |earing a|t the sa|
|000060a0| 6d 65 20 6e 65 73 74 69 | 6e 67 20 6c 65 76 65 6c |me nesti|ng level|
|000060b0| 0a 61 73 20 74 68 65 20 | 6f 75 74 65 72 6d 6f 73 |.as the |outermos|
|000060c0| 74 20 62 61 63 6b 71 75 | 6f 74 65 2e 20 20 54 68 |t backqu|ote. Th|
|000060d0| 65 20 6e 65 73 74 69 6e | 67 20 6c 65 76 65 6c 20 |e nestin|g level |
|000060e0| 69 6e 63 72 65 61 73 65 | 73 20 62 79 20 6f 6e 65 |increase|s by one|
|000060f0| 20 69 6e 73 69 64 65 0a | 65 61 63 68 20 73 75 63 | inside.|each suc|
|00006100| 63 65 73 73 69 76 65 20 | 71 75 61 73 69 71 75 6f |cessive |quasiquo|
|00006110| 74 61 74 69 6f 6e 2c 20 | 61 6e 64 20 64 65 63 72 |tation, |and decr|
|00006120| 65 61 73 65 73 20 62 79 | 20 6f 6e 65 20 69 6e 73 |eases by| one ins|
|00006130| 69 64 65 20 65 61 63 68 | 0a 75 6e 71 75 6f 74 61 |ide each|.unquota|
|00006140| 74 69 6f 6e 2e 0a 0a 5c | 62 65 67 69 6e 7b 73 63 |tion...\|begin{sc|
|00006150| 68 65 6d 65 7d 0a 60 28 | 61 20 60 28 62 20 2c 28 |heme}.`(|a `(b ,(|
|00006160| 2b 20 31 20 32 29 20 2c | 28 66 6f 6f 20 2c 28 2b |+ 1 2) ,|(foo ,(+|
|00006170| 20 31 20 33 29 20 64 29 | 20 65 29 20 66 29 20 25 | 1 3) d)| e) f) %|
|00006180| 0a 20 20 20 20 20 20 20 | 20 20 20 5c 6c 65 76 20 |. | \lev |
|00006190| 20 28 61 20 60 28 62 20 | 2c 28 2b 20 31 20 32 29 | (a `(b |,(+ 1 2)|
|000061a0| 20 2c 28 66 6f 6f 20 34 | 20 64 29 20 65 29 20 66 | ,(foo 4| d) e) f|
|000061b0| 29 0a 28 6c 65 74 20 28 | 28 6e 61 6d 65 31 20 27 |).(let (|(name1 '|
|000061c0| 78 29 0a 20 20 20 20 20 | 20 28 6e 61 6d 65 32 20 |x). | (name2 |
|000061d0| 27 79 29 29 0a 20 20 60 | 28 61 20 60 28 62 20 2c |'y)). `|(a `(b ,|
|000061e0| 2c 6e 61 6d 65 31 20 2c | 27 2c 6e 61 6d 65 32 20 |,name1 ,|',name2 |
|000061f0| 64 29 20 65 29 29 20 25 | 0a 20 20 20 20 20 20 20 |d) e)) %|. |
|00006200| 20 20 20 5c 6c 65 76 20 | 20 28 61 20 60 28 62 20 | \lev | (a `(b |
|00006210| 2c 78 20 2c 27 79 20 64 | 29 20 65 29 25 0a 5c 65 |,x ,'y d|) e)%.\e|
|00006220| 6e 64 7b 73 63 68 65 6d | 65 7d 0a 0a 54 68 65 20 |nd{schem|e}..The |
|00006230| 6e 6f 74 61 74 69 6f 6e | 73 0a 20 5c 62 61 63 6b |notation|s. \back|
|00006240| 71 75 6f 74 65 5c 68 79 | 70 65 72 7b 74 65 6d 70 |quote\hy|per{temp|
|00006250| 6c 61 74 65 7d 20 61 6e | 64 20 7b 5c 74 74 20 28 |late} an|d {\tt (|
|00006260| 71 75 61 73 69 71 75 6f | 74 65 20 5c 68 79 70 65 |quasiquo|te \hype|
|00006270| 72 7b 74 65 6d 70 6c 61 | 74 65 7d 29 7d 0a 20 61 |r{templa|te})}. a|
|00006280| 72 65 20 69 64 65 6e 74 | 69 63 61 6c 20 69 6e 20 |re ident|ical in |
|00006290| 61 6c 6c 20 72 65 73 70 | 65 63 74 73 2e 0a 20 7b |all resp|ects.. {|
|000062a0| 5c 63 66 2c 5c 68 79 70 | 65 72 7b 65 78 70 72 65 |\cf,\hyp|er{expre|
|000062b0| 73 73 69 6f 6e 7d 7d 20 | 69 73 20 69 64 65 6e 74 |ssion}} |is ident|
|000062c0| 69 63 61 6c 20 74 6f 20 | 7b 5c 63 66 20 28 75 6e |ical to |{\cf (un|
|000062d0| 71 75 6f 74 65 20 5c 68 | 79 70 65 72 7b 65 78 70 |quote \h|yper{exp|
|000062e0| 72 65 73 73 69 6f 6e 7d | 29 7d 2c 0a 20 61 6e 64 |ression}|)},. and|
|000062f0| 0a 20 7b 5c 63 66 2c 40 | 5c 68 79 70 65 72 7b 65 |. {\cf,@|\hyper{e|
|00006300| 78 70 72 65 73 73 69 6f | 6e 7d 7d 20 69 73 20 69 |xpressio|n}} is i|
|00006310| 64 65 6e 74 69 63 61 6c | 20 74 6f 20 7b 5c 63 66 |dentical| to {\cf|
|00006320| 20 28 75 6e 71 75 6f 74 | 65 2d 73 70 6c 69 63 69 | (unquot|e-splici|
|00006330| 6e 67 20 5c 68 79 70 65 | 72 7b 65 78 70 72 65 73 |ng \hype|r{expres|
|00006340| 73 69 6f 6e 7d 29 7d 2e | 0a 54 68 65 20 65 78 74 |sion})}.|.The ext|
|00006350| 65 72 6e 61 6c 20 73 79 | 6e 74 61 78 20 67 65 6e |ernal sy|ntax gen|
|00006360| 65 72 61 74 65 64 20 62 | 79 20 5c 69 64 65 7b 77 |erated b|y \ide{w|
|00006370| 72 69 74 65 7d 20 66 6f | 72 20 74 77 6f 2d 65 6c |rite} fo|r two-el|
|00006380| 65 6d 65 6e 74 20 6c 69 | 73 74 73 20 77 68 6f 73 |ement li|sts whos|
|00006390| 65 0a 63 61 72 20 69 73 | 20 6f 6e 65 20 6f 66 20 |e.car is| one of |
|000063a0| 74 68 65 73 65 20 73 79 | 6d 62 6f 6c 73 20 6d 61 |these sy|mbols ma|
|000063b0| 79 20 76 61 72 79 20 62 | 65 74 77 65 65 6e 20 69 |y vary b|etween i|
|000063c0| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 73 2e 0a |mplement|ations..|
|000063d0| 0a 5c 62 65 67 69 6e 7b | 73 63 68 65 6d 65 7d 0a |.\begin{|scheme}.|
|000063e0| 28 71 75 61 73 69 71 75 | 6f 74 65 20 28 6c 69 73 |(quasiqu|ote (lis|
|000063f0| 74 20 28 75 6e 71 75 6f | 74 65 20 28 2b 20 31 20 |t (unquo|te (+ 1 |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.