Giusepe:

> I am not able to express the path using the value "position1" itself

Well, "position1" is just a text value that you are using as, iin effect, a 
key value. REBOL doesn't know it's meant to be a key, not that it has a unique 
value.

In effect your myarray has this structure:

myarray: ["key1" object1 "key2" object2 ...]

So your first step in using a key to locate an object is to search the block:

target-object: select  myarray "position1" 

Then, assuming it was found, you can execute it:

if object? target-object [target-object/myfunc]

A way of one-lining that would be:

do get in select  myarray "position1" 'myfunc

****

I suspect you'll run into scaling problems with your approach -- especially 
if you are aiming at 10,000 objects in the array. If each of those objects is 
abound 5K including the news content of them, then you have a single in-memory 
structure of around 50meg. Saving to disk and reloading will create a 
noticeable pause in the application.

So anything you can do to reduce the size of that one structure will be 
beneficial to the application. As such, taking extra space in each object to 
point 
to the handler functions is likely to be a big overhead. And may make the 
whole thing impossible to save to disk.

I know it's a training exercise, and half the fun of that is playing with the 
limits and seeing what is possible, so I don't want to put you off too much.

But do have a play with the CGIs at REBOL.org that handle the Mailing List 
Archive. That's all done with objects and blocks (including the full text 
indexing), but with a few extra layers to enable it to scale.

http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-index.r

Sunanda.
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to