; $ scheme48 -a batch <<<$'(load "macro-scheme48.scm")' (define-syntax macro:id (syntax-rules () ((_ a) a))) (define-syntax macro:apply (syntax-rules (macro:continuation) ((_ (macro:continuation cont) f a ... (l e ...)) (let-syntax ((_cont (syntax-rules () ((_ (_e (... ...))) (f (macro:continuation cont) a ... _e (... ...)))))) (l (macro:continuation _cont) e ...))) ((_ f a ... (l e ...)) (let-syntax ((_cont (syntax-rules () ((_ (_e (... ...))) (f a ... _e (... ...)))))) (l (macro:continuation _cont) e ...))))) (define-syntax macro:list (syntax-rules (macro:continuation) ((_ (macro:continuation cont) e ...) (cont (e ...))))) (define-syntax macro:wrap (syntax-rules () ((_ f) (let-syntax ((ret (syntax-rules () ((_ c . a) (f . a))))) ret)))) (define (pretty-print x) (display x) (newline)) (pretty-print (macro:apply + 3 (macro:list 1 2 3))) (pretty-print (macro:apply (macro:continuation macro:id) (macro:wrap +) 3 (macro:list 1 2 3))) (pretty-print (apply + 3 (list 1 2 3))) ;================================== $ scheme48 -a batch <<<$'(load "macro-scheme48.scm")' macro-scheme48.scm Warning: segment matching not implemented (a ... (l e ...)) (&syntax-error) Warning: segment matching not implemented (a ... (l e ...)) (&syntax-error) Warning: segment matching not implemented (a ... (l e ...)) (&syntax-error) Warning: too many ...'s (... ...) (&syntax-error) Warning: too many ...'s (... ...) (&syntax-error) Warning: too many ...'s (e ...) (&syntax-error) Warning: segment matching not implemented (a ... (l e ...)) (&syntax-error) Warning: segment matching not implemented (a ... (l e ...)) (&syntax-error) Warning: segment matching not implemented (a ... (l e ...)) (&syntax-error) Warning: too many ...'s (... ...) (&syntax-error) Warning: too many ...'s (... ...) (&syntax-error) Warning: too many ...'s (e ...) (&syntax-error) Warning: segment matching not implemented (a ... (l e ...)) (&syntax-error) Warning: segment matching not implemented (a ... (l e ...)) (&syntax-error) Warning: invalid expression (#{Generated l 480} (#{Generated macro:continuation 480} #{Generated _cont 480}) . syntax-error) (&syntax-error) Warning: invalid expression (#{Generated l 482} (#{Generated macro:continuation 482} #{Generated _cont 482}) . syntax-error) (&syntax-error) syntax-error syntax-error 9 #{Unspecific}