17 lines
300 B
Scheme
17 lines
300 B
Scheme
(define-module (playground macros)
|
|
#:export (inc unless* demo))
|
|
|
|
(define-syntax-rule (inc x)
|
|
(+ x 1))
|
|
|
|
(define-syntax unless*
|
|
(syntax-rules ()
|
|
((_ test body ...)
|
|
(if (not test)
|
|
(begin body ...)))))
|
|
|
|
(define (demo x)
|
|
(unless* (> x 0)
|
|
(display "non-positive"))
|
|
(inc x))
|