Hi, jgart <jg...@dismail.de> skribis:
> How can I step through this code? > > (define-syntax do > (syntax-rules () > ((do ((var init step ...) ...) > (test expr ...) > command ...) > (letrec > ((loop > (lambda (var ...) > (if test > (begin > (if #f #f) > expr ...) > (begin > command > ... > (loop (do "step" var step ...) > ...)))))) > (loop init ...))) > ((do "step" x) > x) > ((do "step" x y) > y))) You can’t: this is a macro and Guile doesn’t have a “macro stepper” (Racket does). What you can do though, is define the macro and expand it on examples of your choosing to see how it behaves: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,expand (do ((x 0 (+ 1 x))) ((>= x 10)) (pk x)) $7 = (let loop ((x 0)) (if (>= x 10) (if #f #f) (begin (pk x) (loop (+ 1 x))))) scheme@(guile-user)> ,optimize (do ((x 0 (+ 1 x))) ((>= x 10)) (pk x)) $8 = (begin (pk 0) (pk 1) (pk 2) (pk 3) (pk 4) (pk 5) (pk 6) (pk 7) (pk 8) (pk 9) (if #f #f)) --8<---------------cut here---------------end--------------->8--- (Personally I’ve never used ‘do’ and I don’t feel like starting today. :-)) Ludo’.