Hello Alex and the PicoLisp community!
My name is Grant and I'm just getting started with picolisp. I'm trying an
exercise to model user-groups and memberships with the Entity/Relation
database. I must be misunderstanding something, or doing something strange
because I can't seem to create/retrieve items the way I expect to. For example:
: (pool "usergroups.db")
(pool "usergroups.db")
-> T
: (class +User +Entity)
(rel nr (+Need +Key +Number))
(rel name (+Need +Idx +String))
(rel memberships (+List +Joint) user (+Membership))
(class +User +Entity)
-> +User
: (rel nr (+Need +Key +Number))
-> +User
: (rel name (+Need +Idx +String))
-> +User
: (rel memberships (+List +Joint) user (+Membership))
-> +User
:
: (obj ((+User) nr 1) name "Grant")
(obj ((+User) nr 1) name "Grant")
-> {2}
: (commit)
(commit)
-> T
: (iter (tree 'name '+User) '((This) (println (: name))))
(iter (tree 'name '+User) '((This) (println (: name))))
"Grant"
"Grant"
"Grant"
-> NIL
:
Why am I seeing three entries? I started with a fresh file when I ran this in
the interpreter. Any help would be welcome. Thanks!
Grant Shangreaux
Sent from ProtonMail mobile