From: Kent Dahl Date: 2002-08-05T02:37:41+09:00 Subject: Re: Detecting when an instance variable is created/set Tom Sawyer wrote: > at this point i wish to SPEAK UP and say once again, i would prefer that > EVERYTHING were OO. i choose ruby over python for this very reason! > (although i like ruby over python despite that now anyway). alas not > even ruby is pure. How would you have assignment be a method? Should everyone redefine and add to the complexity of _one_ method for their own neferious purposes? Or should variables be objects, instances of various subclasses of type Variable? Such as InstanceVariable, so that you could do: class InstanceVariable def =(argument) # funky stuff here end end ....which would drag us back towards a kind of typed variables, but not the statically typed language kind. Hey, this might even be feasible. Already part of this typing is done with symbols such as @ for instance, @@�for class and, $ for global variable. But I can't see much use for it, unless you'd start making instances of your own subclass of InstanceVariable, with overriden assignment. (Since there would be only one InstanceVariable class) But this bites you in the tail and requires you to explicitly state somewhere in your using code what class your variables is, and that bit of code that you thusly need in your initialize or whatever, could just as well have been the explicit assigment you wanted to begin with. Ouch, now my head hurts. I am reminded of the saying "Everything should be as simple as possible, but no simpler." gsub "simple", "object-oriented" #;-P -- (\[ Kent Dahl ]/)_ _~_ __[ http://www.stud.ntnu.no/~kentda/ ]___/~ ))\_student_/(( \__d L b__/ NTNU - graduate engineering - 4. year ) ( \__\_�|�_/__/ ) _)Industrial economics and technological management( \____/_�_\____/ (____engineering.discipline_=_Computer::Technology___)