From: Pit Capitain Date: 2002-07-17T17:22:25+09:00 Subject: Re: TkText no -textvariable workaround? On 17 Jul 2002, at 14:54, Jim Weirich wrote: > 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? It does. In the attempt to make everything an object I also would tend to think of namespace objects receiving something like =(name, value) messages upon an assignment rather than of shoebox objects. Namespace objects could be a subset of bindings. In the recent thread about "class local variables" as in class A a = 5 (...) end the class definition would have its own namespace with an entry for the variable "a". Method definitions and even blocks would have their own namespace, too. The rules for block local variables and the connection to lexically outer scope namespaces could be made explicit in the implementation(s) of the namespace class(es). Regards, Pit