unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* eieio defclass evaluate :initform value
@ 2017-01-04 20:04 Joe Riel
  2017-01-04 20:45 ` Eric Abrahamsen
  2017-01-04 22:43 ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Joe Riel @ 2017-01-04 20:04 UTC (permalink / raw)
  To: Help GNU Emacs

According to the info page for eieio for Emacs 23, one
could do

(defclass foo-class
   ((bar :initform (lambda () my-var)
         :type string)))

When make-instance was called, the lambda expression
for :initform would be evaluated and the expression
assigned to my-var would be used for the slot bar.

The info page for eieio Emacs 24 does not mention this 
functionality and testing shows it no longer exists.

Is there nice way, in 24, to create a class with an :initform
that, upon instantiation, evaluates to the value of a variable?
  

-- 
Joe Riel




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-05 18:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-04 20:04 eieio defclass evaluate :initform value Joe Riel
2017-01-04 20:45 ` Eric Abrahamsen
2017-01-05 16:06   ` Joe Riel
2017-01-05 18:56     ` Eric Abrahamsen
2017-01-04 22:43 ` Stefan Monnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).