added _ to <=> patterns

parent 19669d7c
...@@ -626,21 +626,26 @@ ...@@ -626,21 +626,26 @@
((_ w () code ...) ((_ w () code ...)
(parse<> w (<and> code ...))))) (parse<> w (<and> code ...)))))
(define (pku x) (pk (syntax->datum x)) x)
(define-syntax letify (define-syntax letify
(lambda (x) (lambda (x)
(syntax-case x () (syntax-case x ()
((_ w ((m f) pat val) code ...) ((_ w ((m f) pat val) code ...)
#`(let<>0 w (m #,(tr-pat #'pat) (f val)) code ...)) #`(let<>0 w (m #,(pku (tr-pat #'pat)) (f val)) code ...))
((_ w (m pat val) code ...) ((_ w (m pat val) code ...)
#`(let<>0 w (m #,(tr-pat #'pat) val) code ...))))) #`(let<>0 w (m #,(pku (tr-pat #'pat)) val) code ...)))))
(define (tr-pat x) (define (tr-pat x)
(syntax-case x (quote unquote) (syntax-case x (quote unquote)
((quote _) x) ((quote _) x)
((unquote _) x) ((unquote _) x)
((x . l) #`(#,(tr-pat #'x) #,@(tr-pat #'l))) ((x . l) (cons (tr-pat #'x) (tr-pat #'l)))
(() #'()) (() #'())
(x
(eq? '_ (syntax->datum #'x))
#'x)
( x #'(unquote x)))) ( x #'(unquote x))))
......
...@@ -1426,7 +1426,8 @@ ...@@ -1426,7 +1426,8 @@
(+o m k n)) (+o m k n))
(<define> (*o n m p) (<define> (*o n m p)
(<pp> `(,n ,m ,p)) (<pp> `(*o ,n ,m ,p))
(<if> (<==> ((_ . _) . _) m) (<code> (error "bail out *o")) <cc>)
(<condi> (<condi>
((<=> '() n) (<=> '() p)) ((<=> '() n) (<=> '() p))
((poso n) (<=> '() m) (<=> '() p)) ((poso n) (<=> '() m) (<=> '() p))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment