From: Dossy Date: 2002-07-17T03:07:08+09:00 Subject: Re: TkText no -textvariable workaround? On 2002.07.17, Dave Thomas wrote: > Dossy writes: > > > I did say "academically" -- in a pure OO language where everything > > is an object, the receiver would be the object a, and the method -- or, > > the message being sent, would have been "=(x)" ... > > So, say we have > > a = "hello" > a = 1 > > Then 'a' autovivifies as some proto-object that supports '=(x)'. When > executed, it in turn executes #becomes(x) so that 'a' is now a > String. When the second assignment is executed, then the String object > executes '=(x)', issues another #becomes(x), and 'a' is now a Fixnum. > > Then we have > > a = 2 > > Now we have something interesting. The Fixnum '1' that is currently > 'a' now becomes the Fixnum '2'. But Fixnums are immediate values, so > how are we to implement this? Do all '1's become '2'? Perhaps the problem is that Fixnum's are immediate values. Why is this? In a pure OO implementation, Fixnum's shouldn't exist. There should just be Numbers which inherit from Object, and perhaps Integer, Float, and so on, that inherit from Number. > It's the same problem with any singleton object: > > a = true > a = false > > How can true become false? a.replace(TrueClass.dup) ? > A variable is not an object: it's a reference to one. There is no > object 'a'. Why must variables exist? Why can't there be a Object#reference that returns a reference to an object, so that: a = b.reference Makes a an ObjectReference that delegates to b. Realize: I'm not speaking about what Ruby current *does* but what I might want or expect it TO do. -- Dossy -- Dossy Shiobara mail: dossy@panoptic.com Panoptic Computer Network web: http://www.panoptic.com/ "He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on." (p. 70)