all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: MON KEY <monkey@sandpframing.com>
To: emacs-devel@gnu.org
Subject: eieio's class allocated slots don't show on in object vectors.
Date: Wed, 14 Oct 2009 18:30:33 -0400	[thread overview]
Message-ID: <d2afcfda0910141530v5f8ae733ha62885d2a37b6fe2@mail.gmail.com> (raw)

On "GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600)
    of 2009-10-13 on LENNART-69DE564 (patched)"

|> (describe-function 'describe-class)

,----
| {...}
| If CLASS is actually an object, then also display current values of
that object.
`----

Either the above doesn't make sense as written or `describe-class' doesn't
actually do what the doc says when CLASS _is_ an object.

When a slot has an :allocation :class spec evaluating objects class does not
reveal the value of the class-allocated slot.

|> (defclass tt-c ()
     ((some-s :initarg :some-s
              :allocation :class))
     "doc tt-c")

|> (defvar tt-cA nil)

|> (defvar tt-cB nil)

|> (setq tt-cA (tt-c "this-ttcA"))

|> tt-cA
;=> [object tt-c "this-ttcA"]

|> (setf (slot-value tt-cA 'some-s) "slot :some-s")

|> (slot-value tt-cA 'some-s)
;=> "slot :some-s"

|> (setq tt-cB (tt-c "this-ttcB"))

|> tt-cB
;=> [object tt-c "this-ttcB"]

|> (setf (slot-value tt-cB 'some-s) "slot :some-s onB")

|> tt-cB
;=> [object tt-c "this-ttcB"]

|> (slot-value tt-cB 'some-s)
;=> "slot :some-s onB"

|>(object-slots tt-cA)
;=>nil

(object-slots tt-cB)
;=>nil

|> (describe-class tt-c)

;=> Class tt-c
;   Documentation:
;   doc tt-c
;   Instance Allocated Slots:
;   Class Allocated Slots:
;   Slot: some-s   value = "slot :some-s onB"

|> (describe-class tt-cA)
;=> not-likely, even though a object's symbol is self-quoting.

|> (class-v tt-c)
; lotsa vector

|> (slot-exists-p tt-c 'some-s)
;=> (some-s)

|> (slot-exists-p tt-cA 'some-s)
;=> (some-s)

|> (slot-exists-p tt-cB 'some-s)
;=> (some-s)

|> (slot-boundp tt-cA 'some-s)
;=> t

|> (slot-boundp tt-cB 'some-s)
;=> t

|> (slot-makeunbound tt-cB 'some-s)
;=> unbound

|> (slot-boundp tt-cB 'some-s)
;=> nil

|> (slot-boundp tt-cA 'some-s)
;=> nil

|> (slot-value tt-cA 'some-s)
;=> unbound




                 reply	other threads:[~2009-10-14 22:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2afcfda0910141530v5f8ae733ha62885d2a37b6fe2@mail.gmail.com \
    --to=monkey@sandpframing.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.