<div dir="ltr">Don&#39;t know if this is helpful because I doubt this is new to you, but I have done something like the below:<div><br></div><div>; returns inner let</div><div>(define (my-obj arg val)</div><div>  (let ((arg val) (foo &#39;bar))</div><div>    (curlet)))</div><div><br></div><div>In my use case it&#39;s bigger because I actually have objects that can return their let on a specific message to allow monkey patching them from the repl.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 24, 2021 at 7:30 AM Woody Douglass &lt;<a href="mailto:wdouglass@carnegierobotics.com">wdouglass@carnegierobotics.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I figured out that I can explicitly copy the current environment with<br>
inlet, so my function is now <br>
<br>
(define (make-info name location description) (inlet (curlet)))<br>
<br>
This works for my purposes, but is it idiomatically correct?<br>
<br>
Thanks,<br>
Woody<br>
<br>
On Fri, 2021-09-24 at 09:41 -0400, Woodrow Douglass wrote:<br>
&gt; I&#39;m trying to write a function that makes a simple dictionary of<br>
&gt; informaton<br>
&gt; <br>
&gt; (define (make-info name location description) (curlet))<br>
&gt; <br>
&gt; but it seems that let gets reused or something -- the values seem to<br>
&gt; change when the function gets called more then once<br>
&gt; <br>
&gt; i could just use associative lists by doing<br>
&gt; <br>
&gt; (define (make-info name location description) (let-&gt;list (curlet)))<br>
&gt; <br>
&gt; but i really like how lets work (applicable, etc...)<br>
&gt; What assumption have i gotten wrong? why doesn&#39;t a new let get<br>
&gt; created<br>
&gt; per function call?<br>
&gt; <br>
&gt; Thanks,<br>
&gt; Woody Douglass<br>
<br>
_______________________________________________<br>
Cmdist mailing list<br>
<a href="mailto:Cmdist@ccrma.stanford.edu" target="_blank">Cmdist@ccrma.stanford.edu</a><br>
<a href="https://cm-mail.stanford.edu/mailman/listinfo/cmdist" rel="noreferrer" target="_blank">https://cm-mail.stanford.edu/mailman/listinfo/cmdist</a><br>
</blockquote></div>