"Stephen Compall" wrote: >On Sat, 2007-10-13 at 08:37 +0200, Marco Maggi wrote: >> (body ?args ?body) > >First, invoke that instead of this. Second, does the above pattern >match the below syntax? > >> (body () >> (display 'ciao) >> (newline))
Thanks and sorry, I did multiple errors in converting the real code into an example. The correct example syntax is: |(define-syntax that | (syntax-rules (body handler) | ((_ (body ?body ...) | (handler ?handler-args ?handler ...)) | (catch #t | (lambda () | ?body ...) | (lambda ?handler-args | ?handler ...))))) | |(that (body | (display 'ciao) | (newline)) | (handler (key . args) | #f)) and for the curious the real code is (now fixed, I hope): |(define-syntax with-deferred-exceptions | (syntax-rules (exception-handler deferred-exception-handler lambda begin) | | ((_ (lambda () ?body ...) | (lambda ?handler-args ?handler ...) | (lambda ?deferred-args ?deferred-handler ...)) | (with-fluids ((*gee-deferred-exceptions* '())) | (gee-K (catch #t | (lambda () ?body ...) | (lambda ?handler-args (deferred-catch ?handler ...))) | (run-deferred-exceptions-handler | (lambda ?deferred-args ?deferred-handler ...))))) | | ((_ (begin ?body ...) | (exception-handler ?handler-args ?handler ...) | (deferred-exception-handler ?deferred-args ?deferred-handler ...)) | (with-deferred-exceptions | (lambda () ?body ...) | (lambda ?handler-args ?handler ...) | (lambda ?deferred-args ?deferred-handler ...))) | | ((_ (begin ?body ...) ?first ?form ...) | (with-deferred-exceptions (begin ?body ... ?first) ?form ...)) | | ((_ ?first ?form ...) | (with-deferred-exceptions (begin ?first) ?form ...)))) which accepts both the forms: |(with-deferred-exceptions | (this) | (that) | (exception-handler (key . args) | (do-some-thing)) | (deferred-exception-handler (key . args) | (do-some-other-thing))) | |(with-deferred-exceptions | (lambda () | (this) | (that)) | (lambda (key . args) | (do-some-thing)) | (lambda (key . args) | (do-some-other-thing))) converting the first into the second, and eventually into: |(with-fluids ((*gee-deferred-exceptions* '())) | (gee-K (catch #t | (lambda () (this) (that)) | (lambda (key . args) (deferred-catch (do-some-thing)))) | (run-deferred-exceptions-handler | (lambda (key . args) (do-some-other-thing))))) -- Marco Maggi "Now feel the funk blast!" Rage Against the Machine - "Calm like a bomb" _______________________________________________ Guile-user mailing list [email protected] http://lists.gnu.org/mailman/listinfo/guile-user
