<div><div></div><div><br>
</div></div>I&#39;m not sure I understand the question, though I suspect I may know the<br>
answer. Could you be a bit more specific?<br></blockquote><div><br></div><div>Yes - definitely. See below. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I&#39;m not sure what you mean by &quot;optimized away so they won&#39;t show up on a<br>
call to eval&quot;. And what, spoecifically, are &quot;lexical variables&quot;?<br>
Variables that have scope determined lexically?<br></blockquote><div><br></div><div>Yes I mean variables with scopes determined lexically - I thought that&#39;s what they are called - is there another term for them? lexically-scoped variable/identifier, local variable? </div>

<div><br></div><div>So what I am trying to do is to build an interpreter, hopefully a metacircular one so I can leverage racket as much as possible, but without using the built-in eval, i.e. I need to construct my own lambda, etc. </div>

<div><br></div><div>In this interpreter, identifiers are resolved against a custom environment made of an immutable hash table. This works well for toplevel calls, but when coming to lexically-scoped variables the choice isn&#39;t as certain. </div>
<div><br></div><div>The simplest approach I can think of is to put it into the same environment. This also work nicely w.r.t. shadowing since they effective overwrite the local copy of the environment (it&#39;s an immutable hash table so other references are not affected). </div>
<div><br></div><div>But what I&#39;ve read about lexical scoping is that the variables do not really exist since they are substituted away - they do not leave trace on the namespace: </div><div><br></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div class="gmail_quote"><div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">(let ((a 2)) </font></div></div></div><div class="gmail_quote"><div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"> (eval &#39;a)) </font></div>
</div></div><div class="gmail_quote"><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">;; =&gt; Error: reference to undefined identifier: a</font></div></div></blockquote><div class="gmail_quote">
<div><br></div><div>So I am trying to figure out what is a better representation. </div><div><br></div><div>What I can think of so far all involve some sort of activation frame for holding the values. That basically means I will need to maintain my own stack, and I was trying to see if there are simpler ways to approach the problem.</div>
<div><br></div><div>Please let me know if this is still being unclear. Thanks. </div><div>yc</div><div><br></div><div><br></div></div>