[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fixing "Unknown slot" warnings

From: David Engster
Subject: Re: Fixing "Unknown slot" warnings
Date: Sun, 29 Jan 2017 22:26:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Stefan Monnier writes:
>> After looking at the code, it seems all slot symbols are shoved into
>> `eieio--known-slot-names' and the byte-compiler checks if a slot is in
>> there, regardless of the class being used. So the following would
>> already do the trick:
>> (defmacro eieio-declare-slot (name)
>>   "Declares slot to be available at runtime."
>>   `(eval-when-compile (cl-pushnew ,name eieio--known-slot-names)))
> If you mean something to add to eieio, then yes, that's about right
> (tho you could also do it as (defmacro eieio-declare-slot (name)
> (cl-pushnew name eieio--known-slot-names) nil).

OK, I'll add that to EIEIO.

> My `defclass` solution was meant for use in code that must work with
> older Emacsen and/or older eieio without relying on internals like 
> eieio--known-slot-names.

The new CEDET will only target the current master, so I finally don't
have to care about older Emacsen anymore.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]