emacs-devel
[Top][All Lists]
Advanced

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

Re: Mutating existing persistent data


From: Qiantan Hong
Subject: Re: Mutating existing persistent data
Date: Tue, 7 Dec 2021 06:25:14 +0000

>> Does this really have to be a generalized variable?
>> 
>> Why not use something like `set-persistent-value' and
>> `get-persistent-value'?
> 
> I think we're moving away from get/set pairs.  We could have gone even
> more magical -- reader macros!

I advocate for the real magic — persistent object storage.

I posted sth about it (and also sth else) in
https://lists.gnu.org/archive/html/emacs-devel/2021-12/msg00602.html
Lars, can you comment on it?

Essentially, the interface I’m proposing is 
(make-persistent-store generalized-variable path)

The first time (in the history of universe) it is called,
when path does not exist, it does nothing, but it
initialize the bookkeeping structure.
When it is called later (in potentially a new Emacs 
instance), the full content of generalized-variable is
fully recovered from its last state.

Full content means it will allow arbitrary nested
data, and preserve sharing — it reconstructs an
object graph.

To make the whole thing work, we also need
(persistent-setf generalized-variable value).
Package author should use this instead of
other means of mutation when mutating any
places reachable (aka, “in”) the persistent store.


Best,
Qiantan


reply via email to

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