[REBOL] Re: making objects from block content
From: joel:neely:fedex at: 27-Jun-2002 17:36
Hi, Thorsten,
[moeller_thorsten--GMX--De] wrote:
> Hi List,
>
> i have some trouble with objects.
>
> i have an object-prototype from which i want to produce new objects.
> As well i have a block containing number, which should be the new
> objects name like this.
>
> a: ["2134324" "45674587" "34503"]
>
> the new object should look like this:
>
> 2134324: make prototype [ ID: 2
> Pos: 3
> .....]
>
> this object should be stored in a bigger block and saved to disk,
> so that i can load it later and search for specific objects.
>
> Hope anybody understands what i try to achieve.
>
I'm not sure I do, so let me ask some dumb questions.
* Why are you using objects instead of blocks of key/value pairs?
* Do the objects have behavior (functions)?
* If so, do the objects all have the *same* set of behaviors?
* Do the behaviors need to be saved, or just the data-like
attributes of the blocks?
* Why do you want to use numbers as the "names" of the blocks?
* Could you use the numbers as keys instead?
--
; Joel Neely joeldotneelyatfedexdotcom
REBOL [] do [ do func [s] [ foreach [a b] s [prin b] ] sort/skip
do function [s] [t] [ t: "" foreach [a b] s [repend t [b a]] t ] {
| e s m!zauafBpcvekexEohthjJakwLrngohOqrlryRnsctdtiub} 2 ]