diff options
author | Andy Wingo <wingo@pobox.com> | 2015-01-18 20:53:19 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2015-01-23 16:16:03 +0100 |
commit | 568174d173e994eaac470123bb769a8847be11c7 (patch) | |
tree | 05b2c59c879979524f27eacb760126fa7d361a7f /libguile/goops.c | |
parent | 26a6aaefac07e4f67252a47a5f3e23a305706241 (diff) | |
download | guile-568174d173e994eaac470123bb769a8847be11c7.tar.gz |
Introduce <slot> objects in GOOPS
* module/oop/goops.scm (fold-class-slots): Change format to use proper
slot specifications.
(fold-slot-slots): Flesh out with all needed slots.
(<class>): Update cons-layout to deal with new fold-class-slots form.
Don't create slots; we do that later.
(is-a?, get-keyword, *unbound, unbound?, %allocate-instance): Move
definitions up.
(<slot>, slot?): New definitions.
(slot-definition-name, slot-definition-allocation)
(slot-definition-init-keyword, slot-definition-init-form)
(slot-definition-init-value, slot-definition-init-thunk)
(slot-definition-options, slot-definition-getter)
(slot-definition-setter, slot-definition-accessor)
(slot-definition-slot-ref, slot-definition-slot-set!)
(slot-definition-index, slot-definition-size): New definitions as
accessors on <slot> objects.
(class-slot-definition): Adapt to class-slots change.
(direct-slot-definition-class, make-slot): New definitions.
(make): Define a boot version that can allocate <slot> instances.
(compute-direct-slot-definition)
(compute-direct-slot-definition-initargs)
(effective-slot-definition-class, compute-effective-slot-definition):
New definitions.
(build-slots-list): Adapt to slots being <slot> objects.
(compute-get-n-set): New boot definition.
(allocate-slots): New definition. Replaces
compute-getters-n-setters.
(%compute-layout, %prep-layout): Adapt to changes.
(make-standard-class): Make <slot> objects for direct-slots, and
handle the allocate-slots protocol.
(<foreign-slot>): Inherit from <slot>.
(get-slot-value-using-name, set-slot-value-using-name!)
(test-slot-existence): Adapt to using slot definition objects.
(make-class): Allow slot specs or <slot> objects as the `slots'
argument.
(write): New method on <slot>.
(class-slot-ref, class-slot-set!): Reimplement.
(compute-slot-accessors, compute-getter-method)
(compute-setter-method): Adapt to changes.
(compute-getters-n-setters): Remove. Yay!
(compute-get-n-set): Adapt to use effective slot definitions instead
of the getters-n-setters for #:class / #:each-subclass allocation.
(%initialize-object): Adapt.
(initialize): New method for <slot>. Adapt method for <class>.
* module/oop/goops/active-slot.scm (compute-get-n-set):
* module/oop/goops/composite-slot.scm (compute-propagated-get-n-set):
Use slot-definition-options to access options of slot.
* test-suite/tests/goops.test ("bad init-thunk"): Fix to be a "pass-if"
instead of an "expect-fail".
Diffstat (limited to 'libguile/goops.c')
-rw-r--r-- | libguile/goops.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libguile/goops.c b/libguile/goops.c index 286f3c7dc..398a5d263 100644 --- a/libguile/goops.c +++ b/libguile/goops.c @@ -128,6 +128,7 @@ static SCM class_hashtable; static SCM class_fluid; static SCM class_dynamic_state; static SCM class_frame; +static SCM class_keyword; static SCM class_vm_cont; static SCM class_bytevector; static SCM class_uvec; @@ -973,6 +974,7 @@ SCM_DEFINE (scm_sys_goops_early_init, "%goops-early-init", 0, 0, 0, class_fluid = scm_variable_ref (scm_c_lookup ("<fluid>")); class_dynamic_state = scm_variable_ref (scm_c_lookup ("<dynamic-state>")); class_frame = scm_variable_ref (scm_c_lookup ("<frame>")); + class_keyword = scm_variable_ref (scm_c_lookup ("<keyword>")); class_vm_cont = scm_variable_ref (scm_c_lookup ("<vm-continuation>")); class_bytevector = scm_variable_ref (scm_c_lookup ("<bytevector>")); class_uvec = scm_variable_ref (scm_c_lookup ("<uvec>")); |