On Thu, 17 Jul 2014 09:13:38 +0200
Alexander Burger <a...@software-lab.de> wrote:

> Hello marmorine,
> 

Ummm... Steven. ;)

> 
> A few minor notes:
> 

No quoting for local transient symbols, the the (use (G N) has also
been corrected. These are small things, but very useful for me.

> 
> You may be able to tune that a bit. If you call (pool "words02d.db")
> the default is a single-file database, with a block size of 256.
> 
>    (mapcar size (collect 'wrd '+Wrds))
> 
> Also, it might be better to put the indexes into a separate file(s),
>    (dbs
>       (1 +Wrds)               # 128 Byte/block
>       (4 (+Wrds wid wrd)) )   # 4096 Byte/block
> 

This is what I have been looking at in the meantime, with a break for
the latest heat wave (!), just how thinks look on the disk, where
things are stored and so forth. The "mechanics" of things.

Tried all sorts of size combinations, found one that is more compact, to
use (0 +Wrds) instead of the block size 1 for it. But then I guess you
should take a look with "size" to make sure you are not cutting things
to close? 

> Hmm, I've never done this, but there might be a very efficient
> solution: If you have all words in a single file (and no objects of
> other types), you can access them directly, without index, with the
> 'id' function. You first determine the ID of the last object in the
> file:
> 
>    (setq *Max (id (for (S (seq (db: +Wrds)) S (seq S)) S)))
> 

Actually what I did was your suggestion, Alex. I found it in an old
post in the mail archives. This one works great though, and so I have a
choice, which is nice. And so I left out the wid, used it here.

What I am doing is to translate more or less 1:1 a little Python
program of mine into picolisp, because it uses scheduled learning, and
then set up an index in my database only for those data fields where I
had presets for queries, and this is what comes out (and then
add updates and a gui to it in due time):

   (class +Wrds +Entity)
   (rel wrd (+Key +List +String))
   (rel inf (+String))
   (rel dsp (+Number))
   (rel err (+Ref +Number))
   (rel idat (+Ref +Date))
   (rel ibox (+Ref +Number))
   (rel ldat (+Date))
   (rel lbox (+Ref +Number))
   (rel ndat (+Ref +Date))
   (dbs
      (1 +Wrds)
      (4 (+Wrds wrd idat ndat))
      (0 (+Wrds err ibox lbox)) )
   (pool "words2i.db" *Dbs)

I had (rel wrd (+Ref +List +String)) before and that didn't work,
the collect doesn't find anything in that case:

(mapcan cdr (collect 'wrd '+Wrds (list W "a") (list W "z") 'wrd ) )

Do I have to initialize data by the way, or will things default to
standard values, or just "not be there" until used? And I take it you
only list the indexes you are pushing off into another file, otherwise
they default to being in the first file?





-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to