added _ to <=> patterns

parent 19669d7c
......@@ -626,21 +626,26 @@
((_ w () code ...)
(parse<> w (<and> code ...)))))
(define (pku x) (pk (syntax->datum x)) x)
(define-syntax letify
(lambda (x)
(syntax-case x ()
((_ 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 ...)
#`(let<>0 w (m #,(tr-pat #'pat) val) code ...)))))
#`(let<>0 w (m #,(pku (tr-pat #'pat)) val) code ...)))))
(define (tr-pat x)
(syntax-case x (quote unquote)
((quote _) 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))))
......
......@@ -1426,7 +1426,8 @@
(+o m k n))
(<define> (*o n m p)
(<pp> `(,n ,m ,p))
(<pp> `(*o ,n ,m ,p))
(<if> (<==> ((_ . _) . _) m) (<code> (error "bail out *o")) <cc>)
(<condi>
((<=> '() n) (<=> '() 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