<div dir="ltr">Answering myself! Just didn&#39;t understand the docs properly, got it all working nicely with varlet. <div><br></div><div>Though I am curious to know whether my way of iterating through a keyword assoc list in a constructor is reasonable. This is what I&#39;m doing, feedback most welcome:</div><div><br></div><div>    ;  loop through the init-args keyword arg list, which is an assoc list of sym/value to set<br>    ; this allows setting any instance vars from keyword list to constructor<br>    (let* init-loop ((args init-args))<br>      (if (not (null? args))<br>        (begin <br>          (varlet env (car args) (cadr args))<br>          (init-loop (cddr args)))))<br></div><div><br><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 6, 2021 at 5:06 PM Iain Duncan &lt;<a href="mailto:iainduncanlists@gmail.com">iainduncanlists@gmail.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"><div dir="ltr">Hi folks, I&#39;ve been digging into S7s environment support and loving it. I have implemented a really convenient pseudo-inheritance-through-delegation setup for my process objects, and one thing I&#39;m using is the let-set! function to allow updating internal variables from outside if desired. My little method looks like this (in side of a let inside a function)<div><br></div><div>(define (set sym val)<br>      ;; TODO this doesn&#39;t allow setting values that are not yet set<br>      ;; need to check if symbol is in let and then set it<br>      (let-set! proc-env sym val))<br></div><div><br></div><div>However, this of course errors if I try to use if and sym is not defined. I tried mucking about with the defined?  predicate, but got confused by the docs. If anyone can tell me how I can easily add to the above the following, that would be lovely:</div><div><br></div><div>- if sym not defined in proc-env, define sym to val </div><div><br></div><div>iain</div><div><br></div></div>
</blockquote></div>