emacs-devel
[Top][All Lists]
Advanced

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

Re: Semantics of :initform and oset-default


From: Eric Ludlam
Subject: Re: Semantics of :initform and oset-default
Date: Mon, 09 Feb 2015 19:27:01 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 02/09/2015 09:56 AM, Stefan Monnier wrote:
ELISP> (setq moose 1)
1
ELISP> (oset-default 'foo test '(symbol-value 'moose))
(symbol-value 'moose)
ELISP> (foo "hi")
[object foo "hi" 1]
Yuck!  You just forced EIEIO to use runtime code generation (since it
had to turn the (symbol-value 'moose) list into a chunk of code).

I don't know if that is correct or not.  It didn't occur to me that you
could do that until I tried explaining just now.
Hmm... I wonder if someone relies on this misfeature.


I doubt it. The important function is eieio-oref-default which is used for getting defaults so it can initialize objects, and produce documentation via `describe-class'. I wrote the oset-default to be complete. It's proven useful a couple times, but the cases I have are all pretty simple constants except for the 'singleton' class which isn't that complex either.

Eric



reply via email to

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