Re: modifying classes after they're instantiated

2007-04-14 Thread Bob Rogers
From: "Alek Storm" <[EMAIL PROTECTED]> Date: Thu, 12 Apr 2007 21:55:34 -0500 On 4/11/07, Allison Randal <[EMAIL PROTECTED]> wrote: > They might not clone their classes from the user perspective, but > internally it's the only truly safe way to modify a class that already > has o

Re: modifying classes after they're instantiated

2007-04-12 Thread Alek Storm
On 4/11/07, Allison Randal <[EMAIL PROTECTED]> wrote: > On 4/11/07, Bob Rogers < [EMAIL PROTECTED] > wrote: >>I like this one, but I also have another alternative. First, make all >>class-modification code (add_method, remove_attribute, etc) return a >>PMC*. Whenever one of these m

Re: modifying classes after they're instantiated

2007-04-11 Thread Bob Rogers
From: Allison Randal <[EMAIL PROTECTED]> Date: Wed, 11 Apr 2007 01:12:57 -0700 Alek Storm wrote: > On 4/11/07, Bob Rogers <[EMAIL PROTECTED]> wrote: >> Surely you are not suggesting that any random "add_method" should >> require creating a new class? Did you mean "add_attribute"

Re: modifying classes after they're instantiated

2007-04-11 Thread Allison Randal
Alek Storm wrote: On 4/11/07, Bob Rogers <[EMAIL PROTECTED]> wrote: I like this one, but I also have another alternative. First, make all class-modification code (add_method, remove_attribute, etc) return a PMC*. Whenever one of these methods is called on a class, the class is clon

Re: modifying classes after they're instantiated

2007-04-11 Thread Allison Randal
Leopold Toetsch wrote: Am Mittwoch, 11. April 2007 00:25 schrieb Allison Randal: 3) Modify the core PMC implementation so it tracks information about which the different containers (registers, temporary variables, namespace entries, etc.) that hold a particular PMC, and which particular containe

Re: modifying classes after they're instantiated

2007-04-10 Thread Alek Storm
On 4/11/07, Bob Rogers <[EMAIL PROTECTED]> wrote: I like this one, but I also have another alternative. First, make all class-modification code (add_method, remove_attribute, etc) return a PMC*. Whenever one of these methods is called on a class, the class is cloned . . . What does

Re: modifying classes after they're instantiated

2007-04-10 Thread Bob Rogers
From: "Alek Storm" <[EMAIL PROTECTED]> Date: Wed, 11 Apr 2007 00:02:29 + On 4/10/07, Allison Randal <[EMAIL PROTECTED]> wrote: > 4) Do away with automatic morphing. Attempting to make changes to a > class that's already been instantiated is not allowed (add_method, etc. > wil

Re: modifying classes after they're instantiated

2007-04-10 Thread Alek Storm
On 4/10/07, Allison Randal <[EMAIL PROTECTED]> wrote: 4) Do away with automatic morphing. Attempting to make changes to a class that's already been instantiated is not allowed (add_method, etc. will throw an exception). This also eliminates the need for remove_method, remove_attribute, remove_rol

Re: modifying classes after they're instantiated

2007-04-10 Thread Leopold Toetsch
Am Mittwoch, 11. April 2007 00:25 schrieb Allison Randal: > 3) Modify the core PMC implementation so it tracks information about > which the different containers (registers, temporary variables, > namespace entries, etc.) that hold a particular PMC, and which > particular container was used to make

modifying classes after they're instantiated

2007-04-10 Thread Allison Randal
Jonathan raised a question in the #parrotsketch meeting today about our strategy for safely changing classes that already have instantiated objects. The core problem is this: when you create a class, .local pmc classobj, object classobj = newclass 'Foo' instantiate an object from it, ob