Here is an example of an ?and pattern that checks if an expression is both a number
Question:
Here is an example of an ?and pattern that checks if an expression is both a number and odd:
> (pat-match '(x = (?and (?is ?n numberp) (?is ?n oddp)))
'(x = 3))
((?N . 3))
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Paradigms Of Artificial Intelligence Programming Case Studies In Common Lisp
ISBN: 9781558601918
1st Edition
Authors: Peter Norvig
Question Posted: