[Pharo-project] Issue 3266 in pharo: Clean TextEditor
eliot.miranda at gmail.com
Fri Nov 26 17:19:30 CET 2010
On Wed, Nov 24, 2010 at 6:10 PM, Igor Stasenko <siguctua at gmail.com> wrote:
> On 25 November 2010 03:45, Juan Vuletich <juan at jvuletich.org> wrote:
> > Igor Stasenko wrote:
> >> IMO SimpleMorphic, minus 'color' ivar in Morph class is a way to go.
> >> (i mean get rid that 'color' thing in base class) :)
> > Yep. I fully agree.
> I think, for things like Morphic, where there are dozens of various
> properties expected
> to be in basic morph class, we should use dictionaries, backed up by
> clever VM semantics.
> I cannot stop thinking about extending object format to allow a
> dynamic number of slots per object,
But you don't need to change the object model for this. The VM still
supports the mixed format of named and indexed inst vars (e.g.
MethodContext) and so you can make an object indexed and store properties in
indexed inst vars (e.g. as flattened key, value pairs). The down side is
the cost of become, but one can over-allocate, e.g. room for 8 properties so
that one becomes only every 8th add. Alternatively have an uninitialized
properties inst var which when needed holds a dictionary. Or a global weak
dictionary. Or... And of course all these variants can be mixed, e.g. by
providing a settable policy in the class so different classes ca do
different things. The global properties dictionary can be used as a
fallback when one wants to add a property to an instance of a class that
doesn't implement one of the other policies.
> > Cheers,
> > Juan Vuletich
> Best regards,
> Igor Stasenko AKA sig.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-project