Vegetarianboy30

bills in lisp

Jan 20th, 2021
693
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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))))
RAW Paste Data