emacs-devel
[Top][All Lists]
Advanced

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

Re: using finalizers


From: LdBeth
Subject: Re: using finalizers
Date: Fri, 31 Dec 2021 18:59:30 +0800
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.2 (x86_64-apple-darwin18.7.0) MULE/6.0 (HANACHIRUSATO)

>>>>> In <875yr5p9t3.fsf@logand.com> 
>>>>>   Tomas Hlavaty <tom@logand.com> wrote:

Tomas> One more question: Because make-finalizer in Emacs Lisp does
Tomas> not take the object into account, I have to make sure to hold
Tomas> the reference to the finalizer somehow.  However, this might
Tomas> not be trivial, because a smart compiler could eliminate the
Tomas> reference.  Is this not an issue?

That's being too smart. And I don't think the bytecode compiler can do
the lifetime analaysis right now. It is possible that this could be
changed in future releases of Emacs.

Tomas> Shouldn't make-finalizer take the object as an argument and not
Tomas> rely on me holding the reference explicitly?

You would only need finalizers for complex objects, so ideally you
could use OOP to manage that, probably EIEIO but not limited to that,
and you may even come up with your own.

-- 
LDB



reply via email to

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