/usr/share/doc/racket/reference/let.html is in racket-doc 6.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>3.9 Local Binding: let, let*, letrec, ...</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="extras.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="icons.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">►</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x"><span style="font-weight: bold">The Racket Reference</span></a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="model.html" class="tocviewlink" data-pltdoc="x">Language Model</a></td></tr><tr><td align="right">2 </td><td><a href="notation.html" class="tocviewlink" data-pltdoc="x">Notation for Documentation</a></td></tr><tr><td align="right">3 </td><td><a href="syntax.html" class="tocviewselflink" data-pltdoc="x">Syntactic Forms</a></td></tr><tr><td align="right">4 </td><td><a href="data.html" class="tocviewlink" data-pltdoc="x">Datatypes</a></td></tr><tr><td align="right">5 </td><td><a href="structures.html" class="tocviewlink" data-pltdoc="x">Structures</a></td></tr><tr><td align="right">6 </td><td><a href="mzlib_class.html" class="tocviewlink" data-pltdoc="x">Classes and Objects</a></td></tr><tr><td align="right">7 </td><td><a href="mzlib_unit.html" class="tocviewlink" data-pltdoc="x">Units</a></td></tr><tr><td align="right">8 </td><td><a href="contracts.html" class="tocviewlink" data-pltdoc="x">Contracts</a></td></tr><tr><td align="right">9 </td><td><a href="match.html" class="tocviewlink" data-pltdoc="x">Pattern Matching</a></td></tr><tr><td align="right">10 </td><td><a href="control.html" class="tocviewlink" data-pltdoc="x">Control Flow</a></td></tr><tr><td align="right">11 </td><td><a href="concurrency.html" class="tocviewlink" data-pltdoc="x">Concurrency and Parallelism</a></td></tr><tr><td align="right">12 </td><td><a href="Macros.html" class="tocviewlink" data-pltdoc="x">Macros</a></td></tr><tr><td align="right">13 </td><td><a href="input-and-output.html" class="tocviewlink" data-pltdoc="x">Input and Output</a></td></tr><tr><td align="right">14 </td><td><a href="security.html" class="tocviewlink" data-pltdoc="x">Reflection and Security</a></td></tr><tr><td align="right">15 </td><td><a href="os.html" class="tocviewlink" data-pltdoc="x">Operating System</a></td></tr><tr><td align="right">16 </td><td><a href="memory.html" class="tocviewlink" data-pltdoc="x">Memory Management</a></td></tr><tr><td align="right">17 </td><td><a href="unsafe.html" class="tocviewlink" data-pltdoc="x">Unsafe Operations</a></td></tr><tr><td align="right">18 </td><td><a href="running.html" class="tocviewlink" data-pltdoc="x">Running Racket</a></td></tr><tr><td align="right"></td><td><a href="doc-bibliography.html" class="tocviewlink" data-pltdoc="x">Bibliography</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">▼</a></td><td>3 </td><td><a href="syntax.html" class="tocviewlink" data-pltdoc="x">Syntactic Forms</a></td></tr></table><div class="tocviewsublistbottom" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">3.1 </td><td><a href="module.html" class="tocviewlink" data-pltdoc="x">Modules:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">module</span></span>, <span class="RktSym"><span class="RktStxLink">module*</span></span>, ...</a></td></tr><tr><td align="right">3.2 </td><td><a href="require.html" class="tocviewlink" data-pltdoc="x">Importing and Exporting:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">require</span></span> and <span class="RktSym"><span class="RktStxLink">provide</span></span></a></td></tr><tr><td align="right">3.3 </td><td><a href="quote.html" class="tocviewlink" data-pltdoc="x">Literals:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">quote</span></span> and <span class="RktSym"><span class="RktStxLink">#%datum</span></span></a></td></tr><tr><td align="right">3.4 </td><td><a href="__expression.html" class="tocviewlink" data-pltdoc="x">Expression Wrapper:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">#%expression</span></span></a></td></tr><tr><td align="right">3.5 </td><td><a href="__top.html" class="tocviewlink" data-pltdoc="x">Variable References and <span class="RktSym"><span class="RktStxLink">#%top</span></span></a></td></tr><tr><td align="right">3.6 </td><td><a href="Locations____variable-reference.html" class="tocviewlink" data-pltdoc="x">Locations:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">#%variable-<wbr></wbr>reference</span></span></a></td></tr><tr><td align="right">3.7 </td><td><a href="application.html" class="tocviewlink" data-pltdoc="x">Procedure Applications and <span class="RktSym"><span class="RktStxLink">#%app</span></span></a></td></tr><tr><td align="right">3.8 </td><td><a href="lambda.html" class="tocviewlink" data-pltdoc="x">Procedure Expressions:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">lambda</span></span> and <span class="RktSym"><span class="RktStxLink">case-<wbr></wbr>lambda</span></span></a></td></tr><tr><td align="right">3.9 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Local Binding:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">let</span></span>, <span class="RktSym"><span class="RktStxLink">let*</span></span>, <span class="RktSym"><span class="RktStxLink">letrec</span></span>, ...</a></td></tr><tr><td align="right">3.10 </td><td><a href="local.html" class="tocviewlink" data-pltdoc="x">Local Definitions:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">local</span></span></a></td></tr><tr><td align="right">3.11 </td><td><a href="shared.html" class="tocviewlink" data-pltdoc="x">Constructing Graphs:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">shared</span></span></a></td></tr><tr><td align="right">3.12 </td><td><a href="if.html" class="tocviewlink" data-pltdoc="x">Conditionals:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">if</span></span>, <span class="RktSym"><span class="RktStxLink">cond</span></span>, <span class="RktSym"><span class="RktStxLink">and</span></span>, and <span class="RktSym"><span class="RktStxLink">or</span></span></a></td></tr><tr><td align="right">3.13 </td><td><a href="case.html" class="tocviewlink" data-pltdoc="x">Dispatch:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">case</span></span></a></td></tr><tr><td align="right">3.14 </td><td><a href="define.html" class="tocviewlink" data-pltdoc="x">Definitions:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">define</span></span>, <span class="RktSym"><span class="RktStxLink">define-<wbr></wbr>syntax</span></span>, ...</a></td></tr><tr><td align="right">3.15 </td><td><a href="begin.html" class="tocviewlink" data-pltdoc="x">Sequencing:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">begin</span></span>, <span class="RktSym"><span class="RktStxLink">begin0</span></span>, and <span class="RktSym"><span class="RktStxLink">begin-<wbr></wbr>for-<wbr></wbr>syntax</span></span></a></td></tr><tr><td align="right">3.16 </td><td><a href="when_unless.html" class="tocviewlink" data-pltdoc="x">Guarded Evaluation:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">when</span></span> and <span class="RktSym"><span class="RktStxLink">unless</span></span></a></td></tr><tr><td align="right">3.17 </td><td><a href="set_.html" class="tocviewlink" data-pltdoc="x">Assignment:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">set!</span></span> and <span class="RktSym"><span class="RktStxLink">set!-<wbr></wbr>values</span></span></a></td></tr><tr><td align="right">3.18 </td><td><a href="for.html" class="tocviewlink" data-pltdoc="x">Iterations and Comprehensions:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">for</span></span>, <span class="RktSym"><span class="RktStxLink">for/<span class="mywbr"> </span>list</span></span>, ...</a></td></tr><tr><td align="right">3.19 </td><td><a href="wcm.html" class="tocviewlink" data-pltdoc="x">Continuation Marks:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">with-<wbr></wbr>continuation-<wbr></wbr>mark</span></span></a></td></tr><tr><td align="right">3.20 </td><td><a href="quasiquote.html" class="tocviewlink" data-pltdoc="x">Quasiquoting:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">quasiquote</span></span>, <span class="RktSym"><span class="RktStxLink">unquote</span></span>, and <span class="RktSym"><span class="RktStxLink">unquote-<wbr></wbr>splicing</span></span></a></td></tr><tr><td align="right">3.21 </td><td><a href="Syntax_Quoting__quote-syntax.html" class="tocviewlink" data-pltdoc="x">Syntax Quoting:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">quote-<wbr></wbr>syntax</span></span></a></td></tr><tr><td align="right">3.22 </td><td><a href="__top-interaction.html" class="tocviewlink" data-pltdoc="x">Interaction Wrapper:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">#%top-<wbr></wbr>interaction</span></span></a></td></tr><tr><td align="right">3.23 </td><td><a href="block.html" class="tocviewlink" data-pltdoc="x">Blocks:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">block</span></span></a></td></tr><tr><td align="right">3.24 </td><td><a href="stratified-body.html" class="tocviewlink" data-pltdoc="x">Internal-<wbr></wbr>Definition Limiting:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">#%stratified-<wbr></wbr>body</span></span></a></td></tr><tr><td align="right">3.25 </td><td><a href="performance-hint.html" class="tocviewlink" data-pltdoc="x">Performance Hints:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">begin-<wbr></wbr>encourage-<wbr></wbr>inline</span></span></a></td></tr><tr><td align="right">3.26 </td><td><a href="lazy-require.html" class="tocviewlink" data-pltdoc="x">Importing Modules Lazily:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">lazy-<wbr></wbr>require</span></span></a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">let</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%2A%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">let*</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._letrec%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">letrec</span></span></a></td></tr><tr><td><a href="#%28form._%28%28quote._~23~25kernel%29._let-values%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">let-<wbr></wbr>values</span></span></a></td></tr><tr><td><a href="#%28form._%28%28quote._~23~25kernel%29._let%2A-values%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">let*-<wbr></wbr>values</span></span></a></td></tr><tr><td><a href="#%28form._%28%28quote._~23~25kernel%29._letrec-values%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">letrec-<wbr></wbr>values</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let-syntax%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">let-<wbr></wbr>syntax</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._letrec-syntax%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">letrec-<wbr></wbr>syntax</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let-syntaxes%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">let-<wbr></wbr>syntaxes</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._letrec-syntaxes%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">letrec-<wbr></wbr>syntaxes</span></span></a></td></tr><tr><td><a href="#%28form._%28%28quote._~23~25kernel%29._letrec-syntaxes%2Bvalues%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">letrec-<wbr></wbr>syntaxes+<span class="mywbr"> </span>values</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="lambda.html" title="backward to "3.8 Procedure Expressions: lambda and case-lambda"" data-pltdoc="x">← prev</a> <a href="syntax.html" title="up to "3 Syntactic Forms"" data-pltdoc="x">up</a> <a href="local.html" title="forward to "3.10 Local Definitions: local"" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-part-tag=""let"">3.9<tt> </tt><a name="(part._let)"></a>Local Binding: <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span>, <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%2A%29%29" class="RktStxLink" data-pltdoc="x">let*</a></span>, <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._letrec%29%29" class="RktStxLink" data-pltdoc="x">letrec</a></span>, ...</h4><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p><span class="imageleft"><img src="finger.png" alt="+" width="24" height="24"/></span><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=guide&rel=let.html&version=6.1" class="Sq" data-pltdoc="x">Local Binding</a> in <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=guide&rel=index.html&version=6.1" class="Sq" data-pltdoc="x"><span style="font-weight: bold">The Racket Guide</span></a> introduces local binding.</p></blockquote></blockquote></blockquote><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/letstx-scheme..rkt)._let))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">let</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">val-expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=syntax&rel=stxparse-patterns.html%23%2528form._%2528%2528lib._syntax%252Fparse..rkt%2529._......%252B%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...+</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">let</a></span><span class="hspace"> </span><span class="RktVar">proc-id</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">init-expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=syntax&rel=stxparse-patterns.html%23%2528form._%2528%2528lib._syntax%252Fparse..rkt%2529._......%252B%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...+</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">The first form evaluates the <span class="RktVar">val-expr</span>s left-to-right, creates
a new <a href="eval-model.html#%28tech._location%29" class="techoutside" data-pltdoc="x"><span class="techinside">location</span></a> for each <span class="RktVar">id</span>, and places the values into the
locations. It then evaluates the <span class="RktVar">body</span>s, in which the
<span class="RktVar">id</span>s are bound. The last <span class="RktVar">body</span> expression is in
tail position with respect to the <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span> form. The <span class="RktVar">id</span>s
must be distinct according to <span class="RktSym"><a href="stxcmp.html#%28def._%28%28quote._~23~25kernel%29._bound-identifier~3d~3f%29%29" class="RktValLink" data-pltdoc="x">bound-identifier=?</a></span>.</div></p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktVal">5</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">5</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktVal">5</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktVal">2</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">y</span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktSym">y</span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">'(5 2)</span></p></td></tr></table></blockquote></td></tr></table></p><p>The second form evaluates the <span class="RktVar">init-expr</span>s; the resulting
values become arguments in an application of a procedure
<span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktVar">id</span><span class="stt"> </span><span class="RktMeta"><a href="stx-patterns.html#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span><span class="stt"> </span><span class="RktVar">body</span><span class="stt"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=syntax&rel=stxparse-patterns.html%23%2528form._%2528%2528lib._syntax%252Fparse..rkt%2529._......%252B%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...+</a></span><span class="RktPn">)</span>, where <span class="RktVar">proc-id</span> is bound
within the <span class="RktVar">body</span>s to the procedure itself.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Example:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span><span class="hspace"> </span><span class="RktSym">fac</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">n</span><span class="hspace"> </span><span class="RktVal">10</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._zero~3f%29%29" class="RktValLink" data-pltdoc="x">zero?</a></span><span class="hspace"> </span><span class="RktSym">n</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">1</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._%2A%29%29" class="RktValLink" data-pltdoc="x">*</a></span><span class="hspace"> </span><span class="RktSym">n</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">fac</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._sub1%29%29" class="RktValLink" data-pltdoc="x">sub1</a></span><span class="hspace"> </span><span class="RktSym">n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">3628800</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/letstx-scheme..rkt)._let*))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%2A%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">let*</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">val-expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=syntax&rel=stxparse-patterns.html%23%2528form._%2528%2528lib._syntax%252Fparse..rkt%2529._......%252B%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...+</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span>, but evaluates the <span class="RktVar">val-expr</span>s one by
one, creating a <a href="eval-model.html#%28tech._location%29" class="techoutside" data-pltdoc="x"><span class="techinside">location</span></a> for each <span class="RktVar">id</span> as soon as the value is
available. The <span class="RktVar">id</span>s are bound in the remaining <span class="RktVar">val-expr</span>s
as well as the <span class="RktVar">body</span>s, and the <span class="RktVar">id</span>s need not be
distinct; later bindings shadow earlier bindings.</div></p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Example:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%2A%29%29" class="RktStxLink" data-pltdoc="x">let*</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktVal">1</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">y</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._%2B%29%29" class="RktValLink" data-pltdoc="x">+</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktSym">y</span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">'(2 1)</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/letstx-scheme..rkt)._letrec))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._letrec%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">letrec</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">val-expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=syntax&rel=stxparse-patterns.html%23%2528form._%2528%2528lib._syntax%252Fparse..rkt%2529._......%252B%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...+</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span>, including left-to-right evaluation of the <span class="RktVar">val-expr</span>s,
but the <a href="eval-model.html#%28tech._location%29" class="techoutside" data-pltdoc="x"><span class="techinside">locations</span></a> for all <span class="RktVar">id</span>s are
created first, all
<span class="RktVar">id</span>s are bound in all <span class="RktVar">val-expr</span>s as well as the
<span class="RktVar">body</span>s, and each <span class="RktVar">id</span> is initialized immediately after the
corresponding <span class="RktVar">val-expr</span> is evaluated. The <span class="RktVar">id</span>s must be distinct according to
<span class="RktSym"><a href="stxcmp.html#%28def._%28%28quote._~23~25kernel%29._bound-identifier~3d~3f%29%29" class="RktValLink" data-pltdoc="x">bound-identifier=?</a></span>.</div></p><p>Referencing or assigning to an <span class="RktVar">id</span> before its initialization
raises <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3acontract~3avariable%29%29" class="RktValLink" data-pltdoc="x">exn:fail:contract:variable</a></span>. If an <span class="RktVar">id</span> (i.e.,
the binding instance or <span class="RktVar">id</span>) has an
<a name="(idx._(gentag._90._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">undefined-error-name</span> <a href="stxprops.html#%28tech._syntax._property%29" class="techoutside" data-pltdoc="x"><span class="techinside">syntax property</span></a> whose
value is a symbol, the symbol is used as the name of the variable for
error reporting, instead of the symbolic form of <span class="RktVar">id</span>.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Example:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._letrec%29%29" class="RktStxLink" data-pltdoc="x">letrec</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">is-even?</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">n</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._zero~3f%29%29" class="RktValLink" data-pltdoc="x">zero?</a></span><span class="hspace"> </span><span class="RktSym">n</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">is-odd?</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._sub1%29%29" class="RktValLink" data-pltdoc="x">sub1</a></span><span class="hspace"> </span><span class="RktSym">n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym">is-odd?</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">n</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._and%29%29" class="RktStxLink" data-pltdoc="x">and</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._not%29%29" class="RktValLink" data-pltdoc="x">not</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._zero~3f%29%29" class="RktValLink" data-pltdoc="x">zero?</a></span><span class="hspace"> </span><span class="RktSym">n</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">is-even?</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._sub1%29%29" class="RktValLink" data-pltdoc="x">sub1</a></span><span class="hspace"> </span><span class="RktSym">n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">is-odd?</span><span class="hspace"> </span><span class="RktVal">11</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr></table></blockquote></td></tr></table></p><p class="SHistory">Changed in version 6.0.1.2 of package <span class="stt">base</span>: Changed reference or assignment of an uninitialized <span class="RktVar">id</span> to an error.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((quote._~23~25kernel)._let-values))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._let-values%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">let-values</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">val-expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=syntax&rel=stxparse-patterns.html%23%2528form._%2528%2528lib._syntax%252Fparse..rkt%2529._......%252B%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...+</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara"> Like
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span>, except that each <span class="RktVar">val-expr</span> must produce as many
values as corresponding <span class="RktVar">id</span>s, otherwise the
<span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3acontract%29%29" class="RktValLink" data-pltdoc="x">exn:fail:contract</a></span> exception is raised. A separate <a href="eval-model.html#%28tech._location%29" class="techoutside" data-pltdoc="x"><span class="techinside">location</span></a> is created for each
<span class="RktVar">id</span>, all of which are bound in the <span class="RktVar">body</span>s.</div></p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Example:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._let-values%29%29" class="RktStxLink" data-pltdoc="x">let-values</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktSym">y</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._quotient%2Fremainder%29%29" class="RktValLink" data-pltdoc="x">quotient/remainder</a></span><span class="hspace"> </span><span class="RktVal">10</span><span class="hspace"> </span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktSym">y</span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">'(1 3)</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((quote._~23~25kernel)._let*-values))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._let%2A-values%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">let*-values</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">val-expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=syntax&rel=stxparse-patterns.html%23%2528form._%2528%2528lib._syntax%252Fparse..rkt%2529._......%252B%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...+</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara"> Like
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%2A%29%29" class="RktStxLink" data-pltdoc="x">let*</a></span>, except that each <span class="RktVar">val-expr</span> must produce as many
values as corresponding <span class="RktVar">id</span>s. A separate <a href="eval-model.html#%28tech._location%29" class="techoutside" data-pltdoc="x"><span class="techinside">location</span></a> is created
for each <span class="RktVar">id</span>, all of which are bound in the later
<span class="RktVar">val-expr</span>s and in the <span class="RktVar">body</span>s.</div></p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Example:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._let%2A-values%29%29" class="RktStxLink" data-pltdoc="x">let*-values</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktSym">y</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._quotient%2Fremainder%29%29" class="RktValLink" data-pltdoc="x">quotient/remainder</a></span><span class="hspace"> </span><span class="RktVal">10</span><span class="hspace"> </span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">z</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktSym">y</span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktSym">z</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">'(1 3)</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((quote._~23~25kernel)._letrec-values))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._letrec-values%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">letrec-values</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">val-expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=syntax&rel=stxparse-patterns.html%23%2528form._%2528%2528lib._syntax%252Fparse..rkt%2529._......%252B%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...+</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara"> Like
<span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._letrec%29%29" class="RktStxLink" data-pltdoc="x">letrec</a></span>, except that each <span class="RktVar">val-expr</span> must produce as
many values as corresponding <span class="RktVar">id</span>s. A separate <a href="eval-model.html#%28tech._location%29" class="techoutside" data-pltdoc="x"><span class="techinside">location</span></a> is
created for each <span class="RktVar">id</span>, all of which are bound in all <span class="RktVar">val-expr</span>s
and in the <span class="RktVar">body</span>s.</div></p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Example:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._letrec-values%29%29" class="RktStxLink" data-pltdoc="x">letrec-values</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">is-even?</span><span class="hspace"> </span><span class="RktSym">is-odd?</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="values.html#%28def._%28%28quote._~23~25kernel%29._values%29%29" class="RktValLink" data-pltdoc="x">values</a></span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">n</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._zero~3f%29%29" class="RktValLink" data-pltdoc="x">zero?</a></span><span class="hspace"> </span><span class="RktSym">n</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">is-odd?</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._sub1%29%29" class="RktValLink" data-pltdoc="x">sub1</a></span><span class="hspace"> </span><span class="RktSym">n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">n</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._~3d%29%29" class="RktValLink" data-pltdoc="x">=</a></span><span class="hspace"> </span><span class="RktSym">n</span><span class="hspace"> </span><span class="RktVal">1</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">is-even?</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._sub1%29%29" class="RktValLink" data-pltdoc="x">sub1</a></span><span class="hspace"> </span><span class="RktSym">n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">is-odd?</span><span class="hspace"> </span><span class="RktVal">11</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/letstx-scheme..rkt)._let-syntax))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let-syntax%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">let-syntax</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">trans-expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=syntax&rel=stxparse-patterns.html%23%2528form._%2528%2528lib._syntax%252Fparse..rkt%2529._......%252B%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...+</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p><span class="imageleft"><img src="magnify.png" alt="+" width="24" height="24"/></span>See also <span class="RktSym"><a href="splicing.html#%28form._%28%28lib._racket%2Fsplicing..rkt%29._splicing-let-syntax%29%29" class="RktStxLink" data-pltdoc="x">splicing-let-syntax</a></span>.</p></blockquote></blockquote></blockquote></div></p><p>Creates a <a href="syntax-model.html#%28tech._transformer._binding%29" class="techoutside" data-pltdoc="x"><span class="techinside">transformer binding</span></a> (see
<a href="syntax-model.html#%28part._transformer-model%29" data-pltdoc="x">Transformer Bindings</a>) of each <span class="RktVar">id</span> with the value of
<span class="RktVar">trans-expr</span>, which is an expression at <a href="syntax-model.html#%28tech._phase._level%29" class="techoutside" data-pltdoc="x"><span class="techinside">phase level</span></a> 1
relative to the surrounding context. (See <a href="syntax-model.html#%28part._id-model%29" data-pltdoc="x">Identifiers and Binding</a> for
information on <a href="syntax-model.html#%28tech._phase._level%29" class="techoutside" data-pltdoc="x"><span class="techinside">phase levels</span></a>.)</p><p>The evaluation of each <span class="RktVar">trans-expr</span> is <span class="RktSym"><a href="parameters.html#%28form._%28%28lib._racket%2Fprivate%2Fmore-scheme..rkt%29._parameterize%29%29" class="RktStxLink" data-pltdoc="x">parameterize</a></span>d
to set <span class="RktSym"><a href="Namespaces.html#%28def._%28%28quote._~23~25kernel%29._current-namespace%29%29" class="RktValLink" data-pltdoc="x">current-namespace</a></span> to a <a href="syntax-model.html#%28tech._namespace%29" class="techoutside" data-pltdoc="x"><span class="techinside">namespace</span></a> that shares
<a href="syntax-model.html#%28tech._binding%29" class="techoutside" data-pltdoc="x"><span class="techinside">bindings</span></a> and <a href="eval-model.html#%28tech._variable%29" class="techoutside" data-pltdoc="x"><span class="techinside">variables</span></a> with the namespace being used to
expand the <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let-syntax%29%29" class="RktStxLink" data-pltdoc="x">let-syntax</a></span> form, except that its <a href="syntax-model.html#%28tech._base._phase%29" class="techoutside" data-pltdoc="x"><span class="techinside">base phase</span></a>
is one greater.</p><p>Each <span class="RktVar">id</span> is bound in the <span class="RktVar">body</span>s, and not in other
<span class="RktVar">trans-expr</span>s.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/letstx-scheme..rkt)._letrec-syntax))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._letrec-syntax%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">letrec-syntax</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktVar">trans-expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=syntax&rel=stxparse-patterns.html%23%2528form._%2528%2528lib._syntax%252Fparse..rkt%2529._......%252B%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...+</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p><span class="imageleft"><img src="magnify.png" alt="+" width="24" height="24"/></span>See also <span class="RktSym"><a href="splicing.html#%28form._%28%28lib._racket%2Fsplicing..rkt%29._splicing-letrec-syntax%29%29" class="RktStxLink" data-pltdoc="x">splicing-letrec-syntax</a></span>.</p></blockquote></blockquote></blockquote></div></p><p>Like <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let-syntax%29%29" class="RktStxLink" data-pltdoc="x">let-syntax</a></span>, except that each <span class="RktVar">id</span> is also bound
within all <span class="RktVar">trans-expr</span>s.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/letstx-scheme..rkt)._let-syntaxes))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let-syntaxes%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">let-syntaxes</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">trans-expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=syntax&rel=stxparse-patterns.html%23%2528form._%2528%2528lib._syntax%252Fparse..rkt%2529._......%252B%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...+</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p><span class="imageleft"><img src="magnify.png" alt="+" width="24" height="24"/></span>See also <span class="RktSym"><a href="splicing.html#%28form._%28%28lib._racket%2Fsplicing..rkt%29._splicing-let-syntaxes%29%29" class="RktStxLink" data-pltdoc="x">splicing-let-syntaxes</a></span>.</p></blockquote></blockquote></blockquote></div></p><p>Like <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let-syntax%29%29" class="RktStxLink" data-pltdoc="x">let-syntax</a></span>, but each <span class="RktVar">trans-expr</span> must produce as
many values as corresponding <span class="RktVar">id</span>s, each of which is bound to
the corresponding value.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._racket/private/letstx-scheme..rkt)._letrec-syntaxes))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._letrec-syntaxes%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">letrec-syntaxes</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">trans-expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=syntax&rel=stxparse-patterns.html%23%2528form._%2528%2528lib._syntax%252Fparse..rkt%2529._......%252B%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...+</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p><span class="imageleft"><img src="magnify.png" alt="+" width="24" height="24"/></span>See also <span class="RktSym"><a href="splicing.html#%28form._%28%28lib._racket%2Fsplicing..rkt%29._splicing-letrec-syntaxes%29%29" class="RktStxLink" data-pltdoc="x">splicing-letrec-syntaxes</a></span>.</p></blockquote></blockquote></blockquote></div></p><p>Like <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let-syntax%29%29" class="RktStxLink" data-pltdoc="x">let-syntax</a></span>, except that each <span class="RktVar">id</span> is also bound
within all <span class="RktVar">trans-expr</span>s.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><table cellspacing="0" cellpadding="0" class="RktBlk RForeground"><tr><td><span class="RktPn">(</span><a name="(form._((quote._~23~25kernel)._letrec-syntaxes+values))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._letrec-syntaxes%2Bvalues%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">letrec-syntaxes+values</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">trans-id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">trans-expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">val-id</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">val-expr</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=syntax&rel=stxparse-patterns.html%23%2528form._%2528%2528lib._syntax%252Fparse..rkt%2529._......%252B%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">...+</a></span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Combines <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._letrec-syntaxes%29%29" class="RktStxLink" data-pltdoc="x">letrec-syntaxes</a></span> with a variant of
<span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._letrec-values%29%29" class="RktStxLink" data-pltdoc="x">letrec-values</a></span>: each <span class="RktVar">trans-id</span> and <span class="RktVar">val-id</span> is
bound in all <span class="RktVar">trans-expr</span>s and <span class="RktVar">val-expr</span>s.</div></p><p>The <span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._letrec-syntaxes%2Bvalues%29%29" class="RktStxLink" data-pltdoc="x">letrec-syntaxes+values</a></span> form is the core form for local
compile-time bindings, since forms like <span class="RktSym"><a href="#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._letrec-syntax%29%29" class="RktStxLink" data-pltdoc="x">letrec-syntax</a></span> and
<a href="syntax-model.html#%28tech._internal._definition._context%29" class="techoutside" data-pltdoc="x"><span class="techinside">internal-definition contexts</span></a> expand to it. In a fully expanded
expression (see <a href="syntax-model.html#%28part._fully-expanded%29" data-pltdoc="x">Fully Expanded Programs</a>), the <span class="RktVar">trans-id</span>
bindings are discarded and the form reduces to a combination of
<span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._letrec-values%29%29" class="RktStxLink" data-pltdoc="x">letrec-values</a></span> or <span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._let-values%29%29" class="RktStxLink" data-pltdoc="x">let-values</a></span>, but
<span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._letrec-syntaxes%2Bvalues%29%29" class="RktStxLink" data-pltdoc="x">letrec-syntaxes+values</a></span> can appear in the result of
<span class="RktSym"><a href="stxtrans.html#%28def._%28%28quote._~23~25kernel%29._local-expand%29%29" class="RktValLink" data-pltdoc="x">local-expand</a></span> with an empty stop list.</p><p>For variables bound by <span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._letrec-syntaxes%2Bvalues%29%29" class="RktStxLink" data-pltdoc="x">letrec-syntaxes+values</a></span>, the
<a href="eval-model.html#%28tech._location%29" class="techoutside" data-pltdoc="x"><span class="techinside">location</span></a>-creation rules differ slightly from
<span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._letrec-values%29%29" class="RktStxLink" data-pltdoc="x">letrec-values</a></span>. The <span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">val-id</span><span class="stt"> </span><span class="RktMeta"><a href="stx-patterns.html#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29" class="RktStxLink" data-pltdoc="x">...</a></span><span class="RktPn">)</span><span class="stt"> </span><span class="RktVar">val-expr</span><span class="RktPn">]</span> binding
clauses are partitioned into minimal sets of clauses that satisfy the
following rule: if a clause has a <span class="RktVar">val-id</span> binding that is
referenced (in a full expansion) by the <span class="RktVar">val-expr</span> of an
earlier clause, the two clauses and all in between are in the same
set. If a set consists of a single clause whose <span class="RktVar">val-expr</span> does
not refer to any of the clause’s <span class="RktVar">val-id</span>s, then
<a href="eval-model.html#%28tech._location%29" class="techoutside" data-pltdoc="x"><span class="techinside">locations</span></a> for the <span class="RktVar">val-id</span>s are created <span style="font-style: italic">after</span> the
<span class="RktVar">val-expr</span> is evaluated. Otherwise, <a href="eval-model.html#%28tech._location%29" class="techoutside" data-pltdoc="x"><span class="techinside">locations</span></a> for all
<span class="RktVar">val-id</span>s in a set are created just before the first
<span class="RktVar">val-expr</span> in the set is evaluated.</p><p>The end result of the <a href="eval-model.html#%28tech._location%29" class="techoutside" data-pltdoc="x"><span class="techinside">location</span></a>-creation rules is that scoping
and evaluation order are the same as for <span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._letrec-values%29%29" class="RktStxLink" data-pltdoc="x">letrec-values</a></span>, but
the compiler has more freedom to optimize away <a href="eval-model.html#%28tech._location%29" class="techoutside" data-pltdoc="x"><span class="techinside">location</span></a>
creation. The rules also correspond to a nesting of
<span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._let-values%29%29" class="RktStxLink" data-pltdoc="x">let-values</a></span> and <span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._letrec-values%29%29" class="RktStxLink" data-pltdoc="x">letrec-values</a></span>, which is how
<span class="RktSym"><a href="#%28form._%28%28quote._~23~25kernel%29._letrec-syntaxes%2Bvalues%29%29" class="RktStxLink" data-pltdoc="x">letrec-syntaxes+values</a></span> for a fully-expanded expression.</p><p>See also <span class="RktSym"><a href="local.html#%28form._%28%28lib._racket%2Flocal..rkt%29._local%29%29" class="RktStxLink" data-pltdoc="x">local</a></span>, which supports local bindings with
<span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span>, <span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define-syntax%29%29" class="RktStxLink" data-pltdoc="x">define-syntax</a></span>, and more.</p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="lambda.html" title="backward to "3.8 Procedure Expressions: lambda and case-lambda"" data-pltdoc="x">← prev</a> <a href="syntax.html" title="up to "3 Syntactic Forms"" data-pltdoc="x">up</a> <a href="local.html" title="forward to "3.10 Local Definitions: local"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|