Hi,<br><br>In trying to take up the fall-through case challenge in "a little macro exercise," I came up with this so far:<br><br>(define-syntax cas-cad-e<br> (syntax-rules (break go!)<br> ((_ go! v () a) (let ((mtc #f)) (call/cc (lambda (break) . a))))<br>
((cas-cad-e go! v (((bv ...) . b) . r) (a ...))<br> (cas-cad-e go!<br> v<br> r<br> (a ... (when (or mtc<br> (and (memq v '(bv ...))<br> (begin (set! mtc #t) #t)<br>
))<br> . b))))<br> ((_ v br . d) (cas-cad-e go! v (br . d) ()))))<br><br>I haven't looked at anyone else's solution yet. But setting aside questions of concision and correctness, I can't even run it. Consider:<br>
<br>> (cas-cad-e 2 ((1) 3))<br>reference to undefined identifier: mtc<br><br>I don't get it. Isn't mtc safely bound in my let? Here's the expansion:<br><br>> (syntax->datum (expand '(cas-cad-e 2 ((1) 3))))<br>
(let-values (((mtc) '#f))<br> (#%app<br> call/cc<br> (lambda (break)<br> (if (let-values (((or-part) (#%top . mtc)))<br> (if or-part<br> or-part<br> (if (#%app memq '2 '(1)) (begin (set! mtc '#t) '#t) '#f)))<br>
(begin '3)<br> (#%app void)))))<br><br>Thanks in advance for your help,<br>RM<br>