[eieio] Modified eieio-method-obarray's obarrays after the first call, and obarray optimisation.

drkm <[email protected]> Fri, 08 Jul 2005 20:10:54 +0200
Newsgroups gmane.emacs.cedet,gmane.emacs.eieio
Organization None
Message-ID <[email protected]>
  Hi

  I just see something I don't understand.  Calling a generic
function modifying the eieio-method-obarray's obarrays of this
generic function.  Here is an example:

    (defclass C () ())

    (defmethod f ((c C))
      (message "f(C): %s" c))

    (get 'f 'eieio-method-obarray)

      ==>
        [[0 0 0 0 0 0 0 0 0 0 0]
         [0 0 0 0 0 0 0 0 0 0 0]
         [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C 0 ... 0]
         [0 0 0 0 0 0 0 0 0 0 0]
         nil nil nil]

    (f (make-instance 'C))

    (get 'f 'eieio-method-obarray)

      ==>
        [[0 0 0 0 0 0 0 0 0 0 0]
         [0 C 0 0 0 0 0 0 0 0 0]
         [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C 0 ... 0]
         [0 C 0 0 0 0 0 0 0 0 0]
         nil nil nil]

  Symbols were created in the :AFTER and :STATIC obarrays.

    (let* ((obarrays  (get 'f 'eieio-method-obarray))
           (after-ob  (aref obarrays 1))
           (after-sym (aref after-ob 1))
           (prim-ob   (aref obarrays 2))
           (prim-sym  (aref prim-ob 26))
           (stat-ob   (aref obarrays 3))
           (stat-sym  (aref stat-ob 1)))
      (mapcar (lambda (s)
                (when (fboundp s)
                  (symbol-function s)))
              (list after-sym prim-sym stat-sym)))

      ==>
        (nil
         (lambda (c)
           (message "f(C): %s" c))
         nil)

  Are these symbols rights?  Where they are created?

  BTW, I don't really understand what is the obarray
optimisation.  Can someone explain it in a few lines?

  Thanks,

--drkm



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar