I want to use the trivia library and I am using SBCL.
I want to be able to match a Scheme expression:
(match '(let ((n 2)) (* n 2))
((letp a b) (list a)))
(defun letp (exp)
(and (lisp exp) (equal (car exp) 'let)))
I have tried to create my own type:
(match '(let ((n 2)) (* n 2))
((letp a b) (list a)))
(defun let-p (exp)
(and (lisp exp) (equal (car exp) 'let)))
(deftype letp ()
`(satisfies let-p))
I have done it like this:
(match '(let ((n 2)) (+ n 1))
((guard x (list-p x)) (car (cdr x))))
The above works but I want something cleaner.
Thanks