[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: EIEIO accessing class slots
From: |
pillule |
Subject: |
Re: EIEIO accessing class slots |
Date: |
Fri, 11 Jun 2021 02:23:37 +0200 |
Stefan Monnier via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:
>>>> How can I accede to the initarg of an eieio class?
>>> What do you mean exactly by that and why do you need that?
>> [description of your code]
>> This need adjustments but I hope you get the idea.
>
> Sadly, this describes your code (with reference to unexplained things
> like "the get-or-create of the object"), so no I don't understand what
> you're doing at all, and I don't know what those values are
> meant to hold, so I don't know what you mean to do.
>
> E.g. why do you do
>
> (oref-default 'moirai-dired-side :display-alist)
>
> instead of
>
> (oref-default 'moirai-dired-side 'display-alist)
>
> ?
because it don't work.
however
(oref-default 'moirai-dired-side display-alist)
does work. Im confused.
> Also, why do you need to do (oref-default 'moirai-dired-side
> :display-alist), what do you expect it to return?
The default value inherited by some of the objects.
> If you expect it to return the ((moirai-dired-p) ...)
> you specified in the `defclass`, then why not do:
>
> (defvar foo-bar '((moirai-dired-p) ...))
>
> so you can get this value without having to ask the class?
Is that terrible to ask to the class ?
I attached an archive of the files incriminated; it is short,
a superclass defined in moirai-core.el and a class defined in
a temp file named moirai-eieio.el if ever that can help.
moirai.tar.gz
Description: moirai early stage
--