Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] How do I dynamically extend an object! instance Re:(4)

From: bobr:dprc at: 13-Sep-2000 0:05

At 03:42 PM 9/12/00 -0700, [jeff--rebol--net] wrote:
> > Bob: > >> ok here is my latest method for extending an object >> in-situ. the example hasnt been turned into a function and >> I hope I am not violating any storage but here goes... [ >> >> a: make object! [ >> addr: "417 howser st" name: "joyce haversham" ] >> >> wds: first a vals: second a >> >> append wds 'email append vals "[joyce--someplace]" >> >> probe a >> >> ] >> >> now this -looks- fine, you can save/probe/mold the object >> and read it back in with no problems. > > FIRST obj and SECOND obj have returned copies of the object > word and value blocks since last year or so. Modifying > those blocks will not affect the original object.
Rats, I knew it was too good to be true! I see in current version 'save, 'mold and 'probe all use the real values not the copies. So this used-to-work but for reasons of our own protection has been made unworkable? perhaps I should try another track... most object based systems try to respect that an object should resist external change and only undergo transformation when initiated from within. you cant change an object unless it wants to change {reminds me of an old light bulb joke} or provides an access method to facilitate the change. can a function be made (within the object) that self-extends the object? what would that function look like?
> -jeff >
;# mailto: [bobr--dprc--net]