mes: Test optargs without pmatch.
* tests/optargs.test: Remove pmatch.
This commit is contained in:
parent
6f81fe41b0
commit
d4f311c1df
|
@ -58,9 +58,8 @@ exit $?
|
||||||
(pass-if-equal "optargs key default" #f ((lambda* (#:key (foo #f)) foo)))
|
(pass-if-equal "optargs key default" #f ((lambda* (#:key (foo #f)) foo)))
|
||||||
|
|
||||||
(cond-expand
|
(cond-expand
|
||||||
(guile (use-modules (system base pmatch)
|
(guile (use-modules (ice-9 optargs)))
|
||||||
(ice-9 optargs)))
|
(mes))
|
||||||
(mes (mes-use-module (mes pmatch))))
|
|
||||||
|
|
||||||
(define <info> '<info>)
|
(define <info> '<info>)
|
||||||
(define <functions> '<functions>)
|
(define <functions> '<functions>)
|
||||||
|
@ -69,12 +68,11 @@ exit $?
|
||||||
(define <text> '<text>)
|
(define <text> '<text>)
|
||||||
|
|
||||||
(define* (make o #:key (functions '()) (globals '()) (locals '()) (text '()))
|
(define* (make o #:key (functions '()) (globals '()) (locals '()) (text '()))
|
||||||
(pmatch o
|
(list <info>
|
||||||
(<info> (list <info>
|
|
||||||
(cons <functions> functions)
|
(cons <functions> functions)
|
||||||
(cons <globals> globals)
|
(cons <globals> globals)
|
||||||
(cons <locals> locals)
|
(cons <locals> locals)
|
||||||
(cons <text> text)))))
|
(cons <text> text)))
|
||||||
|
|
||||||
;; (define* (make o #:key (functions '()) (globals '()) (locals '()) (text '()))
|
;; (define* (make o #:key (functions '()) (globals '()) (locals '()) (text '()))
|
||||||
;; (format (current-error-port) "make\n")
|
;; (format (current-error-port) "make\n")
|
||||||
|
@ -86,20 +84,16 @@ exit $?
|
||||||
;; (cons <text> text))))))
|
;; (cons <text> text))))))
|
||||||
|
|
||||||
(define (.functions o)
|
(define (.functions o)
|
||||||
(pmatch o
|
(assq-ref (cdr o) <functions>))
|
||||||
((<info> . ,alist) (assq-ref alist <functions>))))
|
|
||||||
|
|
||||||
(define (.globals o)
|
(define (.globals o)
|
||||||
(pmatch o
|
(assq-ref (cdr o) <globals>))
|
||||||
((<info> . ,alist) (assq-ref alist <globals>))))
|
|
||||||
|
|
||||||
(define (.locals o)
|
(define (.locals o)
|
||||||
(pmatch o
|
(assq-ref (cdr o) <locals>))
|
||||||
((<info> . ,alist) (assq-ref alist <locals>))))
|
|
||||||
|
|
||||||
(define (.text o)
|
(define (.text o)
|
||||||
(pmatch o
|
(assq-ref (cdr o) <text>))
|
||||||
((<info> . ,alist) (assq-ref alist <text>))))
|
|
||||||
|
|
||||||
(define (info? o)
|
(define (info? o)
|
||||||
(and (pair? o) (eq? (car o) <info>)))
|
(and (pair? o) (eq? (car o) <info>)))
|
||||||
|
|
Loading…
Reference in a new issue