Vegetarianboy30

bills in lisp

Jan 20th, 2021
1,079
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.30 KB | None | 0 0
  1. (defun make-comparison-expr (field value)
  2.   `(equal (getf cd ,field) ,value))
  3.  
  4. (defun make-comparisons-list (fields)
  5.   (loop while fields
  6.         collecting (make-comparison-expr (pop fields) (pop fields))))
  7.  
  8. (defmacro where (&rest clauses)
  9.   `#'(lambda (cd) (and ,@(make-comparisons-list clauses))))
Add Comment
Please, Sign In to add comment