Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; A maths list is of the form:
- ; (r d d d ...)
- ; where r is an operator
- ; and d is either a maths list or a number.
- (defun maths-list-p (expr)
- (if (not (member (first expr) '(+ - * /))) ;check r
- NIL
- (loop
- for i in (rest expr)
- if (not (or (numberp i) (maths-list-p i))) return NIL ;check d
- finally return T)))
Advertisement
Add Comment
Please, Sign In to add comment