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 19:41:26 +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 <87bl0xm39e.fsf@logand.com> 
>>>>>   Tomas Hlavaty <tom@logand.com> wrote:

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

Tomas> What do you mean?

Tomas> Why not do it "properly" and future-proof the make-finalizer interface,
Tomas> pass the object explicitly there and leave the rest as implementation
Tomas> detail instead of leaking the issue to the programmer?

Isn't it doesn't make sense to associate a primitive data types such
as numbers, symbols, strings with a finalizer? If you need such a
feature on primitive data types, you are probably using this in a way
not intended.

And meawhile it would be problematic to hardcode what kinds of objects
are allowed to have objects. Notice this is a C function so it is not
very flexible.

You can think this is the primitive API that Emacs provides, and
people can build up more higher level ones that suit their particular
needs.



reply via email to

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