[REBOL] Re: How do I dynamically modify an object?
From: edanaii:cox at: 14-Jan-2003 15:34
Gregg Irwin wrote:
>Hi Ed,
>
>ED> Using the examples from the REBOL On-line dictionary:
>ED> >> Example: Make Object! [ Name: "Fred" Age: 5000000 ]
>ED> >> Get in Example 'Name
>ED> == "Fred"
>ED> >> Set in Example 'Name "Fred Flintstone"
>ED> == "Fred Flintstone"
>
>example/name: "Fred Flintstone"
>
>ED> How do I dynamically add to example, after it has been created, Address:
>ED> "123 Bedrock Path".
>
>ED> I tried using 'Set, 'Make and a couple other functions, but they didn't
>ED> work. I was probably using them wrong. :)
>
>Just use your object as a prototype with MAKE and put your new field
>in the spec block.
>
>example: make example [address: "123 bedrock path"]
>
>make object! [
> Name: "Fred Flintstone"
> Age: 5000000
> address: "123 bedrock path"
>]
>
I know how to do that. That is not what I was asking. :)
How do I (Can I?) add Address to an _existing_ object *after* that
object has been created.
I'm assuming it's not possible...
And why would I want to do this? Why not? =)
--
Sincerely, | Tell me, tell me, where I'm going; I don't know
Ed Dana | where I've been. Tell me, tell me. Oh won't you
Software Developer | tell me, and then tell me again! My body's aching,
1Ghz Athlon Amiga | my heart is breaking and I don't know where to go!
| So tell me, tell me, why don't you tell me? I just
| gotta know! - Styx, Crystal Ball