emacs-devel
[Top][All Lists]
Advanced

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

Re: EIEIO default constructor function


From: Mario Lang
Subject: Re: EIEIO default constructor function
Date: Sun, 04 Apr 2021 04:42:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> So my question is, what is the rationale behind *always* creating a
>> wrapper for `make-instance'?
>
> You'll have to ask Eric Ludlam ;-)

I guessed as much :-).  I should probably have put him on CC.

>> Could we perhaps add some sort of
>> class-option to disable the wrapper creation?
>
> We could, yes.  I suggest you `M-x report-emacs-bug` so we don't forget.
> Ideally attach a patch ;-)

If a patch is welcome, I might look into that.

> We may also want to make those constructor functions conditional on
> `eieio-backward-compatibility`.

Oh, that is a good idea.  According to my test, CLOS does not create a wrapper 
by
default, so hiding that behaviour behind `eieio-backward-compatibility'
seems like what I would want to aim for.

> You might also consider using `cl-defstruct`, which
> doesn't suffer from such problems and is lighter weight.

I was actually trying that at first, but it turned out I need
inheritance based dynamic dispatch.  So I am actually very grateful for eieio
being merged into Emacs proper, `defclass' *is* handy if you need its
power.

-- 
CYa,
  ⡍⠁⠗⠊⠕



reply via email to

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