Download stackerizer-tutorial.zip
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#lang br/quicklang (provide + *) (define-macro (stackerizer-mb EXPR) #'(#%module-begin (for-each displayln (reverse (flatten EXPR))))) (provide (rename-out [stackerizer-mb #%module-begin])) (define-macro (define-ops OP ...) #'(begin (define-macro-cases OP [(OP FIRST) #'FIRST] [(OP FIRST NEXT (... ...)) #'(list 'OP FIRST (OP NEXT (... ...)))]) ...)) (define-ops + *)
1 2
#lang s-exp "stackerizer.rkt" (* 3 (+ 8 4))