emacs-devel
[Top][All Lists]
Advanced

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

Re: New package: resist!


From: Qiantan Hong
Subject: Re: New package: resist!
Date: Sun, 12 Dec 2021 01:30:31 +0000

>> It’s not really an implementation of a persistent (key value) store,
>> it’s more like an object oriented prin1.
> 
> How does your package handle values whose print syntax can't just be
> `read' to recreate the value?
Currently I haven’t account for it, it will prob — it’s easy to add
a `condition-case` that catches error and warns in the next revision.
Do you have any better suggestions?

> You must for each of these edge cases make a special condition to invent 
> some sort of print value, and recognize it back when reading it…  That is, 
> you must invent a way to prin1 it anyway. 
AFAIU, eieio-persistent looks almost like a generic prin1.
However it doesn’t work on native Lisp objects —
it basically does the thing what we need but with a very weird interface
(e.g. it expect the object itself to remember where it should write to,
which makes it basically impossible to define sensible method on native 
objects).
An interface like 
(object-write THIS &optional PRINTCHARFUN) makes much more sense to me.

How can we fix this? If this is fixed, we could use such extensible prin1 for 
all
persistence operation.

Also another namespace problem: the extensible prin1 probably shouldn’t live
in persist-*, because kv-* will depend on this extensible prin1. 
But it now becomes unclear what namespace it should lives in (kv-* doesn’t make
much sense IMO).

I’m now more convinced that this whole matter is more of an Elisp language
extension rather than a package. If we insist to not utilize global namespace,
it probably would need to be divided into lots of namespace.
Is it agreed that each file should use only one namespaces?
Then we would also need to scatter code into quite a few files.

reply via email to

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