Urgh ...<br><br> (define (setup hook) <br> (let ((settings (##closure-ref hook 1))) <br> (##vector-set! settings 1 #t) <br>
(if (##not (##memq proc ##trace-list)) <br> (set! ##trace-list (##cons proc ##trace-list))))) <br><br>does ##closure-ref do what I think it does? (break the closure abstraction ... and is the "1" like saying "the first var [which just so happens to be settings]")<br>
<br>this seems awfully hairy + brittle<br><br><div class="gmail_quote">On Sun, Feb 22, 2009 at 11:33 PM, lowly coder <span dir="ltr"><<a href="mailto:lowlycoder@huoyanjinjing.com">lowlycoder@huoyanjinjing.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">In lib/_repl.scm:<br><br>(define-prim (##make-default-entry-hook) <br>
(let ((settings (##vector #f #f))) <br> (lambda (proc args execute) <br>
(if (##vector-ref settings 0) <br> (##step-on)) ;; turn on single-stepping <br> (if (##vector-ref settings 1) <br>
(##trace-generate <br> (##make-call-form proc <br> (##argument-list-remove-absent! args '()) <br>
##max-fixnum) <br> execute <br> #f) <br>
(execute)))))<br><br>how does this code work at all? isn't settings #f #f, which would mean the first if does nothing, and the first part of the second if also does nothing?<br><br>is there some funky dynamic-wind / dynamic scope going on here?<br>
</blockquote></div><br>