emacs-devel
[Top][All Lists]
Advanced

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

Re: Slot accessing issues in EIEIO


From: Stefan Monnier
Subject: Re: Slot accessing issues in EIEIO
Date: Thu, 07 May 2020 22:09:58 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> To better understand, I suggest that I'll throw some solutions so you
>> can shoot them down explaining why they're not applicable.
>> Would it work to use the `slot-missing` generic function?
> I think the above addresses that.  But I guess the questions becomes
> "Well, what about `slot-unbound' then?".

Here's another solution instead of the pair-of-objects solution:

For each slot, use two different slot names:
- one for the "virtual slot" corresponding to a data base column.
- one for the "real slot" that caches the value from the database.

So when `slot-value` accesses a virtual slot, you get to `slot-unbound`
which can then lookup (and fill if needed) the corresponding real slot
(whose name can presumably be obtained by adding or removing some
prefix/suffix).


        Stefan




reply via email to

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