Hi Alex,

Does this look reasonable? I tried to implement key-value store/get. I am
not sure how to enumerate all the keys though.


(pool "test.db")


(set *DB "ROOT")


(de kv-add (k v)

        (let nv (new T)

                (set nv v)

                (put *DB k nv)

                (commit)))


(de kv-get (k)

        (val (get *DB k)))



Regards,

Kashyap



On Sun, Apr 14, 2019 at 1:58 PM C K Kashyap <ckkash...@gmail.com> wrote:

> Thanks Alex!
> Regards,
> Kashyap
>
> On Sun, Apr 14, 2019 at 1:20 PM Alexander Burger <a...@software-lab.de>
> wrote:
>
>> On Sun, Apr 14, 2019 at 12:54:19PM -0700, C K Kashyap wrote:
>> > Is the builtin database in picolisp tied to OOP? The documentation
>> seems to
>> > indicate it.
>>
>> Not necessarily. The DB consists of three independent layers.
>>
>> Persistent "external" symbols are the base. They are directly in the core
>> language. They are used to implement b-trees, and in addition - and on
>> top of
>> those - the entity and relation objects (only those are OOP).
>>
>>
>> > Is there a way I could use the DB to just accrue immutable
>> > facts (just like Clojure Datomic works)?
>>
>> Just create external symbols (with 'new' without a class), and store
>> stuff into
>> their values and property lists.
>>
>>
>> > Is there a non-OOP sample that I could use as a starting point?
>>
>> The tutorial at https://software-lab.de/doc/tut.html#ext
>>
>> ☺/ A!ex
>>
>> --
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>
>

Reply via email to