Simplify and optimize slot access
authorAndy Wingo <wingo@pobox.com>
Fri, 23 Jan 2015 13:55:35 +0000 (14:55 +0100)
committerAndy Wingo <wingo@pobox.com>
Fri, 23 Jan 2015 15:16:04 +0000 (16:16 +0100)
commit4bde3f04ea2c573a871b5f377b5f41d970dc8ebe
tree8b77684c10c7fb60b52e339a112e5fa2cd42269b
parent193e2c52dc18ea79ec37cef744ea8c6ef97c2cb3
Simplify and optimize slot access

* module/oop/goops.scm (fold-slot-slots): Add `slot-ref/raw' slot, which
  is what the slot-ref slot was.  Now the slot-ref slot checks that the
  slot is bound, if needed.
  (slot-definition-slot-ref/raw): Define.
  (make-slot): Adapt.  Also, effective slot definition slots have no
  initargs.
  (define-standard-accessor-method, bound-check-get, standard-get)
  (standard-set): Move definitions up.
  (allocate-slots): Adapt.  If the slot has an init thunk, we don't need
  to check that it's bound.
  (slot-ref, slot-set!, slot-bound?): Simplify.
  (class-slot-ref): Use the raw getter so that we can call
  `slot-unbound' with just the class.
  (compute-getter-method, compute-setter-method): Simplify to just use
  the slot-ref / slot-set! functions from the slot.
  (%initialize-object): Simplify.
module/oop/goops.scm