From: Tom Sawyer Date: 2002-07-05T10:04:39+09:00 Subject: Re: self_parent hi sean, yes, the REXML site was probably not the best. but self_parent in effect does give one a quick, simple and sort-of "natural" means of defining contains/container relationships, such that a "contained" object can use self_parent to "look up" to its "container" object. accessible or not, there is a relationship between the two objects. the one was created within the other --the creation-parent did in fact create the child and can thus "look down" upon the child. as things stand there is no default means to go the other way. yet the relationship stands nonetheless. that's why i tend to think ruby probably has this information stored within it already anyway. so why not make that a useful tool? ~transami On Thu, 2002-07-04 at 18:16, Sean Russell wrote: > David Alan Black wrote: > > > REXML is specifically modeling the parent/child relationships of XML > > in that class, though (I think). That's different from a > > language-level (I mean Ruby, not XML) description of one object as the > > "parent" of another because the second object is created by a method > > of the first object. > > Yes. A REXML parent/child relationship has nothing to do with object > inheritance, but rather describes a contains/contained by relationship. > > This is clouded by the fact that, in XML, elements can be seen to 'inherit' > attributes from their parents -- namespaces, in particular. Still, this is > more of a scoping issue than a direct inheritance issue. > > Put another way, parent/child in REXML is a homonym to parent/child in Ruby > -- same words, different meaning. > > -- > |.. "Even the Mongols rejected Communism... are we more dumb?" > <|> --- Russian newspaper headline supporting Yeltzin's 1996 campaign > /|\ > /| > | > > -- ~transami "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin