[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using finalizers
From: |
Tomas Hlavaty |
Subject: |
Re: using finalizers |
Date: |
Fri, 31 Dec 2021 13:01:11 +0100 |
On Fri 31 Dec 2021 at 19:41, LdBeth <andpuke@foxmail.com> wrote:
>>>>>> 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.
This is irrelevant, I am not talking about that.
> 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.
This primitive API that Emacs provides relies on the implicit assumption
of the compiler being not smart. I do not see how that is a good idea.
Re: using finalizers, Eli Zaretskii, 2021/12/31
Re: using finalizers, LdBeth, 2021/12/31