Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defmacro deft (name &body slots)
- `(defstruct (,name (:conc-name)
- (:constructor
- ,name
- ,(loop
- for s in slots
- collect (typecase s
- (symbol s)
- (cons (first s))))))
- ,@(loop
- for s in slots
- collect
- (append (typecase s
- (symbol (list s nil))
- (cons s))
- (list :read-only t)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement