Skip to content

Instantly share code, notes, and snippets.

@g000001
Created November 30, 2013 13:07
Show Gist options
  • Save g000001/7718867 to your computer and use it in GitHub Desktop.
Save g000001/7718867 to your computer and use it in GitHub Desktop.
;;; AspectL
;; http://sourceforge.net/p/closer/aspectl/ci/master/tree/
;; http://common-lisp.net/project/aspectl/overview.html
;; http://clozure.com/pipermail/openmcl-devel/2013-April/014253.html
(defclass person ()
((name :accessor name :initarg :name)))
;=> #<STANDARD-CLASS PERSON>
(describe (make-instance 'person))
;>> #<PERSON {101C4214F3}>
;>> [standard-object]
;>>
;>> Slots with :INSTANCE allocation:
;>> NAME = #<unbound slot>
;>>
;=> <no values>
(aspectl:with-class 'person
(aspectl:class-add
:direct-slots
'(age :accessor age :initarg :age)))
;=> #<STANDARD-CLASS PERSON>
(describe (make-instance 'person))
;>> #<PERSON {101C4E21F3}>
;>> [standard-object]
;>>
;>> Slots with :INSTANCE allocation:
;>> AGE = #<unbound slot>
;>> NAME = #<unbound slot>
;>>
;=> <no values>
(aspectl:with-class 'person
(aspectl:class-remove :direct-slots 'name))
;=> #<STANDARD-CLASS PERSON>
(describe (make-instance 'person))
;>> #<PERSON {101C6014F3}>
;>> [standard-object]
;>>
;>> Slots with :INSTANCE allocation:
;>> AGE = #<unbound slot>
;>>
;=> <no values>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment