[REBOL] Re: The all function.
From: anton:lexicon at: 15-Apr-2002 14:53
First of all, I have never bothered to use
hash before, so perhaps I will miss some
hash specific details.
As far as I know, hash!s are very similar to blocks.
That means you can put in any number of any
datatype.
There is, due to the key, duplication of data in
the database. The code appears before each
object and within each object. I would try to
eliminate one of them.
I would simplify your hash to a series of
objects only (with the keys in the objects.)
However, that may well not be very speedy.
So you may decide to have two keys then an object,
or store all your keys and data in the objects.
You will need to modify your functions either way.
With your two key example, this line will not work:
all [find database code find database chknum]
It would find code somewhere, then chknum somewhere else,
but who says they are together? Nobody. ;)
Use this instead:
find/skip database reduce [key1 key2] 3
The skip refinement treats the series as records
of fixed number of objects, which is 3 in this case
(2 keys and 1 object).
Anton.