<div dir="ltr">Don'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 'bar))</div><div> (curlet)))</div><div><br></div><div>In my use case it'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 <<a href="mailto:wdouglass@carnegierobotics.com">wdouglass@carnegierobotics.com</a>> 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>
> I'm trying to write a function that makes a simple dictionary of<br>
> informaton<br>
> <br>
> (define (make-info name location description) (curlet))<br>
> <br>
> but it seems that let gets reused or something -- the values seem to<br>
> change when the function gets called more then once<br>
> <br>
> i could just use associative lists by doing<br>
> <br>
> (define (make-info name location description) (let->list (curlet)))<br>
> <br>
> but i really like how lets work (applicable, etc...)<br>
> What assumption have i gotten wrong? why doesn't a new let get<br>
> created<br>
> per function call?<br>
> <br>
> Thanks,<br>
> 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>