2 ms·
It's interesting to note that Lisp has some "def easys", just not for classes. There is a defsetf for simple situations, so you don't have to use define-setf-ex
by kazinator 9y ago
It's interesting to note that Lisp has some "def easys", just not for classes. There is a defsetf for simple situations, so you don't have to use define-setf-expander. defsetf's simplicity isn't one-size-fits-all either; it has a short form and a longer form. In the same area of functionality, there is define-modify-macro which handles simple cases, freeing the user from calling get-setf-expansion and dealing with its return values.
P.S.
(read-from-string (concatenate 'string ":" (string x)))
==> (intern (string x) 'keyword)
`(error ,(concatenate 'string "initarg required: " (string x))
==> `(error "initarg required: ~s" ',x)