by radu_floricica · 17y ago · 0 comments
(get client :phone)
(:phone client)
(client :phone)
It takes some getting used to, but I already came to expect (and enjoy) that any symbol I use can be a function.
(defmacro deftable (name)
`(progn
(defparameter ,name (make-hash-table))
(defun ,name (k)
(gethash k ,name))
(defsetf ,name (k) (v)
`(setf (gethash ,k ,',name) ,v))))
now you can do:
(deftable client), which creates the hashtable, and then(client 'phone) will retrieve the value,
(setf (client 'phone) '4444444) will set the value.
(defun all (test seq)
(funcall (notfn #'some) (complement (testify test)) seq))
doesn't seem that bad.