[REBOL] Re: Block building
From: landi::mac::com at: 24-Nov-2002 22:00
Thanks Scott and Ingo,
That was exactly the feedback I was looking for. I look forward to the
day when all possible solutions come to my mind as easily as they seem
to come to yours.
My actual object has more values in it than the Object1 example I gave,
but I could see using the dynamic content discovery techniques you
suggested in another area.
Ted
On Sunday, Nov 24, 2002, at 17:13 Canada/Eastern, Ingo Hohmann wrote:
> Hi Ted and Scott,
>
> G. Scott Jones wrote:
>
>> Hi, Ted,
>>
>> From: Ted Landis
>>
>> <...>
>> If you have really dynamic code, and therefore don't know in advance
>> what components are in the object, you can take advantage of getting
>> 'first on the object:
>
> Or you could use 'second
>
> >> probe second object1
> [
> make object! [
> String1: "ABC"
> Block1: ["DEF" "GHI"]
> Block2: ["JKL" "MNO" "PQRSTUVWXYZ"]
> ] "ABC" ["DEF" "GHI"] ["JKL" "MNO" "PQRSTUVWXYZ"]]
> == [ ...
>
> As you see, 'second object! returns the object! itself, followed by a
> list of all values. So, you could use something like this:
>
> >> block: copy []
> == []
> >> repeat value next second object1 [ insert block value ]
> == ["DEF" "GHI" "ABC"]
> >> block
> == ["JKL" "MNO" "PQRSTUVWXYZ" "DEF" "GHI" "ABC"]
>
> Kind regards,
>
> Ingo
>
> --
> To unsubscribe from this list, please send an email to
> [rebol-request--rebol--com] with "unsubscribe" in the subject, without the
> quotes.
>
Ted
Without deviation from the norm, progress is not possible.
-- Frank Zappa