clean up code
This commit is contained in:
parent
85db821ad2
commit
7af2f1e11d
|
@ -1,7 +1,7 @@
|
||||||
|
(define-library (picrin syntax-rules)
|
||||||
(import (scheme base)
|
(import (scheme base)
|
||||||
(scheme cxr)
|
(scheme cxr)
|
||||||
(picrin macro)
|
(picrin macro))
|
||||||
(scheme write))
|
|
||||||
|
|
||||||
;;; utility functions
|
;;; utility functions
|
||||||
(define (reverse* l)
|
(define (reverse* l)
|
||||||
|
@ -318,18 +318,4 @@
|
||||||
|
|
||||||
`(,_syntax-error "malformed syntax-rules"))))))
|
`(,_syntax-error "malformed syntax-rules"))))))
|
||||||
|
|
||||||
;;; test code
|
(export syntax-rules))
|
||||||
(import (scheme write))
|
|
||||||
|
|
||||||
(define-syntax hoge
|
|
||||||
(syntax-rules ()
|
|
||||||
((hoge (a ...) ...) '((a ...) ...))
|
|
||||||
((hoge (a b) ...) '(a ...))
|
|
||||||
((hoge a b ... c . d) 'c)))
|
|
||||||
|
|
||||||
(display (hoge (1 2 3) (3 4 5) (5 6 7)))
|
|
||||||
(newline)
|
|
||||||
(display (hoge (a b) (c d) (e f)))
|
|
||||||
(newline)
|
|
||||||
(display (hoge a b c))
|
|
||||||
(newline)
|
|
||||||
|
|
Loading…
Reference in New Issue