Musings about modularity and programming in the large

Igor Stasenko siguctua at gmail.com
Fri Jan 25 00:08:26 UTC 2008


On 24/01/2008, itsme213 <itsme213 at hotmail.com> wrote:
> (All this may be painfully obvious to others, and this is somewhat off-topic
> from the original post, apologies ...)
>
> >"Andreas Raab" <andreas.raab at gmx.de> wrote Not unless you really recreate
> >the full ST-80 model. There is a ton of subtleties in the design which is
> >hard to recreate properly.
>
> I'm sure I overlook tons of stuff :)
>
> > ... but as soon as you introduce new Metaclasses in the structure you are
> > breaking the inheritance of the metaclass hierarchy.
>
> If you will bear with me ... perhaps you mean this in the sense of the
> "Uniform and safe metaclass composition" paper by Stephane et al. Ruby does
> object-level customization in a way which retains the inheritance structure,
> roughly as follows:
>
> x = String.new
> class << x
>   def dance_and_sing
>     ...
>   end
> end
>
> x.dance_and_sing
>
> - if object x is instanceOf (a regular, non-singleton) class C
> - customizing object x (e.g. dance_and_sing above) will
>   - insert an anonymous singleton class xC' _below_ C
>      (if needed; not if x already had a singleton class)
>   - put x customomizations into xC'
>   - x is still (indirectly) an instance of the original C
>
> Would something like that be relevant to not breaking the inheritance of the
> metaclass hierarchy?
>

I heard about this a while ago. IIRC perl having per-object behavior
customization.
But this can be easily made , when object model is prototype based
(perl/javascript).
And in ST we having a class-based model.
Btw, can you show us a 'killer' use case of such language feature,
which shows great benefit comparing to class-based model? I'm very
intrigued. :)


-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list