<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-06-13 5:30 GMT+07:00 Bradley Lucier <span dir="ltr"><<a href="mailto:lucier@math.purdue.edu" target="_blank">lucier@math.purdue.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"><br>
> On Jun 11, 2017, at 5:08 AM, Adam <<a href="mailto:adam.mlmb@gmail.com">adam.mlmb@gmail.com</a>> wrote:<br>
><br>
> Possibly the "macro-force-vars", which is used all over the runtime and compiler, would have something to do with this, but I don't find its definition anywhere.<br>
><br>
<br>
</span>In _gambit#.scm:<br>
<br>
(macro-define-syntax macro-force-vars<br>
  (lambda (stx)<br>
    (syntax-case stx ()<br>
      ((_ vars expr)<br>
       (if (let* ((co<br>
                   (##global-var-ref<br>
                    (##make-global-var '##compilation-options)))<br>
                  (comp-opts<br>
                   (if (##unbound? co) '() co)))<br>
             (assq 'force comp-opts))<br>
<br>
           (syntax-case (datum->syntax<br>
                         #'vars<br>
                         (map (lambda (x) `(,x (##force ,x)))<br>
                              (syntax->list #'vars)))<br>
               ()<br>
             (bindings #'(let bindings expr)))<br>
<br>
           #'expr)))))<br>
<br>
</blockquote></div><br></div><div class="gmail_extra">Ah right, <a href="https://github.com/gambit/gambit/blob/9c3dcbdc322a10673370c0880696ba131144251d/lib/_gambit%23.scm#L316">https://github.com/gambit/gambit/blob/9c3dcbdc322a10673370c0880696ba131144251d/lib/_gambit%23.scm#L316</a> , and used to be a define-macro, <a href="https://github.com/gambit/gambit/blob/29103e6a29b8fbbf7d6fc772a344b814be3f1c1a/lib/_gambit%23.scm#L492">https://github.com/gambit/gambit/blob/29103e6a29b8fbbf7d6fc772a344b814be3f1c1a/lib/_gambit%23.scm#L492</a> , and all the rest of the code is meticulously padded with its use.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">This also sheds a bit of light on why the slot containing the promise is not replaced with the forced value. Maybe that would be possible in some situations though.. When |x| is a symbol, it could be |set!| with the forced value?</div><div class="gmail_extra"><br></div><div class="gmail_extra">That would cover standard variable slots and not typedef, vector, pair etc. slots though, I guess I'd need to dig in a bit more to understand how this one actually works out. If you have any spontaneous ideas, feel free to share.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Any idea where in the sources fundamental primitives like |+| , |if| , |or| autoforce?</div></div>