Hi Cle,

> Ahhh ... this was a copy/paste error from the console into the mail. My
> DB file was named "test" :-)
> ...
> Ahhh not for me ... as I am working within another directory parallel to
> picoLisp ;-)

I see. This explains it ;-)


> > If 'new' is called this way, it will not create database objects but
>...
> :-O But ... but ... but ... URGHS! :-( I had looked especially into the
> "x.db" file and found my keys "1", "11" and "111" there. So I thought

Right. I never tried it this way, but the reason is that though there
were memory-only objects created, the relation-handling side-effects of
'+Ref' etc. were executed, so that the indexes were in the file but not
the objects.


> ... in my real program I used 'new!' and *not* 'new'. So

OK, good :-)


> Ok, perhaps I could use the Lisp 'db' function when I have a direct
> access :-) But anyway I will also need the Pilog 'db' clause. But I
> would need it with a functionality like SQL
> 
>    select ID, SRC, TGT
>      from +Test
>    where ID = "1"'
> 
> an *not*
> 
>    select ID, SRC, TGT
>       from +Test
>     where ID like "1%"
> 
> is there any way to achieve my goal?

The way I would use is the already-discussed 'collect'

   : (collect 'id '+Test "1")
   -> ({2})

or, more close to your 'select'

   : (for This (collect 'id '+Test "1")
      (println (: id) (: src) (: tgt)) )
   "1" "A" "B"
   -> "B"


If you really prefer Pilog also for direct accesses, then you can still
call it the direct way:

   : (? (@Test db 'id '+Test "1"))
    @Test={2}

or, via a variable

   : (? @ID "1" (@Test db 'id '+Test (-> @ID)))
    @ID="1" @Test={2}  


I'll study your project now ... Looks interesting :-)

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to