louis's Blog

louis's Avatar Image
Software developer #Go #CommonLisp #JS #SQL. #LispWorks user. Soft spots for #Emacs #SmallWeb. Recently becoming #OpenBSD enthusiast.

Other hobbies: #Running #FireFighter #StarTrek
← All posts

While I work through the book PAIP I realize that my programmer brain is still highly imperative. But #Lisp and #CommonLisp shines when you start to write down your master problem in form of a (pseudo-)function and go from there:

A Lisp pseudo-function:

(defun maybe-same-accommodation ()
(select all-objects
(where (all ((not (same :master-id))
(similar (:nane))
(equal :type)
(has_:images)))
(some (within-distance :position :kn 1) (similar (:zipcode)))
(perhaps (sinilar (:street))
(similar (:place))))))
A Lisp pseudo-function: (defun maybe-same-accommodation () (select all-objects (where (all ((not (same :master-id)) (similar (:nane)) (equal :type) (has_:images))) (some (within-distance :position :kn 1) (similar (:zipcode))) (perhaps (sinilar (:street)) (similar (:place))))))
To like or reply, open original post on Emacs.ch