<div dir="ltr">Thanks Bill, yes that was it. I had figured out that was the (first!) error before you replied, but my solution was much more rube-goldbergish than yours, so much appreciated.<div><br></div><div>Of course now I&#39;ve realized it needs to be recursive, silly me. (+ %1 %2) works, but not (+ (+ %1 %2) %3).  gah!</div><div><br></div><div>iain</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 8, 2021 at 10:09 AM &lt;<a href="mailto:bil@ccrma.stanford.edu">bil@ccrma.stanford.edu</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 think the &quot;sexp&quot; argument to map is just the<br>
macro argument name &#39;sexp, so map can&#39;t figure<br>
out what to do, and asks make-iterator to do<br>
something (hence the make-iterator error).  I<br>
would write the macro:<br>
<br>
(define-macro (run-expr sexp)<br>
   `(eval (map<br>
          (lambda(token)<br>
             (if (and (symbol? token)<br>
                     (eq? ((symbol-&gt;string token) 0) #\%))<br>
                `(s4m-expr-inputs ,(string-&gt;number (substring (symbol-&gt;string token) <br>
1)))<br>
                token))<br>
          ,sexp))<br>
<br>
so (s4m-run-expr &quot;(+ %1 %2 %3)&quot;) returns 66.<br>
<br>
If you omit the eval (to see what code is being generated),<br>
<br>
   (s4m-run-expr &quot;(+ %1 %2 %3)&quot;)<br>
<br>
returns<br>
<br>
   (+ (s4m-expr-inputs 1) (s4m-expr-inputs 2) (s4m-expr-inputs 3))<br>
<br>
</blockquote></div>