feat: add pigibrack macro expansion tool
This commit is contained in:
16
playground/macros.scm
Normal file
16
playground/macros.scm
Normal file
@@ -0,0 +1,16 @@
|
||||
(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))
|
||||
Reference in New Issue
Block a user