[Top][All Lists]

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

Re: Persistence of variables

From: Emanuel Berg
Subject: Re: Persistence of variables
Date: Wed, 28 Mar 2018 15:09:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Marcin Borkowski wrote:

> I think you misunderstood me. Storing data in
> a file is natural. Having a separate file for
> just one variable looks like an overkill.

Then create a file in your home dir called
.pervert - the persistent variable register.

It can be an XML file or just a text file like

    caliber     5.56
    insulation  none
    tire        650B
    LSD         ALD-52

("just a text file" doesn't make it any less of
a database than an XML ditto by the way)

Now write a parser that will search the file
for e.g. the key "tire" and return the data
item "650B".

Because you said you at this point only have
a single variable, you don't need to worry
about sorting (at least not for the sake of an
algorithm parsing it being too slow), but it
can be nice to have it sorted anyway - and easy
to do like any Emacs buffer, even automatically
on insert - nice because you might come to
realize this file is handy also for
manual [1] use, e.g. when writing to the math
faculty and having to look up pi (3.1415..) and
so on :) No, seriously!

I'm pretty sure someone already did an Emacs
framework/interface to populate, change, and
retrieve data from such a text DB file?

[1] Remember the words (mantra/motto) of the UK
    intelligence service: Knowledge gives
    strength to the hands.

underground experts united

reply via email to

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