Whither SmallScript? (was Re: Integer micro-benchmarks)

phil hunt philh at comuno.freeserve.co.uk
Wed May 2 12:09:45 EDT 2001


On Wed, 02 May 2001 04:10:45 GMT, James A. Robertson <jarober at mail.com> wrote:
>Greg Ewing wrote:
>> 
>> Martin von Loewis wrote:
>> >
>> > andy at toolshed.com (Andrew Hunt) writes:
>> >
>> > > Can you continue to dynamically add methods to classes at runtime?
>> >
>> > Yes, you can.
>> 
>> You can also change the class of an object and rearrange
>> the inheritance hierarchy at runtime, just in case you
>> were wondering. And add or remove instance variables
>> dynamically, too (I don't think that one is so easy in
>> Smalltalk).
>
>Sure it is.  
>
>MyClass addInstVarName: 'foo'
>
>MyClass removeInstVarName: 'foo'

In Python you can an instance variale to *just one* instance of a 
class with all the other instances remaining unchanged.

-- 
*****[ Phil Hunt ***** philh at comuno.freeserve.co.uk ]*****
Pstream class library for C++: a Parsing Stream library that 
facilitates writing lexical analysers and other programs
that parse data files. Available on an open source license from
<http://www.vision25.demon.co.uk/oss/phlib/intro.html>

               




More information about the Python-list mailing list