all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

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.