1.6 Defining Simple Macros
Defines a macro named macro-id; equivalent to the following:
Examples: |
> (define-simple-macro (fn x:id rhs:expr) (lambda (x) rhs)) | > ((fn x x) 17) | 17 | > (fn 1 2) | fn: expected identifier | at: 1 | in: (fn 1 2) | | > ((fn2 a b (+ a b)) 3 4) | 7 | > (fn2 a #:b 'c) | fn2: expected identifier | at: #:b | in: (fn2 a #:b (quote c)) |
|
Defines a macro named macro-id; equivalent to:
Examples: |
| > ((fn3 x x) 17) | 17 | > ((fn3 a b (+ a b)) 3 4) | 7 | > (fn3 1 2) | fn3: expected identifier | at: 1 | in: (fn3 1 2) | > (fn3 a #:b 'c) | fn3: expected identifier or expected expression | at: #:b | in: (fn3 a #:b (quote c)) |
|