From: Jim Weirich Date: 2002-07-17T14:54:44+09:00 Subject: Re: TkText no -textvariable workaround? >>>>> "Hal" == Hal E Fulton writes: Hal> In a "radically object-oriented" language like Ruby, it seems natural Hal> that assignment *would* be a method (as it is even in C++ and Java). C++ only defines assignment when you are assign to an object. Assignments to pointers and references are not methods. Object assignment is very limited. The resulting object is "sliced" to fit into the allocation memory location. You can assign objects of child classes into an object of a parent class, but the resulting object will be a Parent object (not a child). Polymorphism go right out the door. Unless my brain is failing me, I don't recall assignments as methods in Java. Hal> This leads me to think there must be a good reason why it is *not* Hal> implemented this way. I think that thinking of "a = b" as an assignment is the wrong way of looking at it. Languages like FORTRAN, Pascal, and even C/C++ tend to think of variables as shoeboxes into which you place a value. The shoebox is a holder for the value. Languages like Lisp have a different view. In Lisp, names are bound to the values they represent. The name doesn't reference a memory location (i.e. shoebox) that can hold a value. The name is bound to a value because there is a namespace (sometimes called an alist or association list) that mentions the name and value together. I have found it benificial to think of Ruby assignments to be more like Lisp style name binding, rather than an C++ like assignment statements. But I'm not sure I can articulate the reasons I find this view better. Does this strike a chord with anyone else? -- -- Jim Weirich jweirich@one.net http://w3.one.net/~jweirich --------------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)