Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. (quote a) -> a
  2. (quote {}) -> {}
  3.  
  4. CL-USER> (quote ())
  5. NIL
  6.  
  7. (defun as-keyword (sym)
  8. (intern (string sym) :keyword))
  9.  
  10. (defun slot->defclass-slot (spec)
  11. (let ((name (first spec)))
  12. `(,name :initarg ,(as-keyword name) :accessor ,name)))
  13.  
  14. (defmacro define-binary-class (name slots)
  15. `(defclass ,name ()
  16. ,(mapcar #'slot->defclass-slot slots)))
  17.  
  18. (define-binary-class id3-tag
  19. ((major-version)))
  20.  
  21. (DEFCLASS ID3-TAG NIL
  22. ((MAJOR-VERSION :INITARG :MAJOR-VERSION :ACCESSOR MAJOR-VERSION)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement