At 02:59 PM 8/13/2001 -0700, Kurt D. Starsinic wrote:
>On Mon, Aug 13, 2001 at 04:18:43PM -0400, Dan Sugalski wrote:
> > Okay, here's a question for everyone.
> >
> > I'm currently designing the object-specific opcodes for the Parrot
> > interpreter. Most of this is pretty straightforward (methods, attributes,
> > and suchlike things) but at the moment I'm a bit stumped on the whole 
> issue
> > of HAS-A relationships. (Well, that and designing a way to handle
> > delegation flexibly as everyone and their brother's got a different way of
> > doing it, and some people have multiple ways...)
> >
> > More specifically, should the interpreter handle HAS-A things at all? And,
> > if so, what sort of functionality should be built in, vs what should I
> > expect languages to provide in layering functionality? (It also influences
> > what the interpreter's objects are known to have--we need an array to 
> stick
> > the hasa things into, if nothing else)
>
>     It doesn't seem Perlish to me for the interpreter to provide _special_
>support for HAS-A.  HAS-A is too general of a design pattern to warrant
>pigeonholing into a particular object relationship.

IS-A is in the same boat, as are object attributes. Given that those are 
already interesting problems, it seemed reasonable to include interpreter 
support for at least some HAS-A relationships for automatic delegation and 
suchlike things. I'm not proposing we jam support for all HAS-A things, 
just a few of the more common ones. Or if that's not feasable, then a 
design that has a reasonable hook so classes can intercept this for 
themselves somehow.

>HAS-A can indicate
>delegation, brokering, snooping, containing, proxying . . . and there are
>many unique and appropriately distinct implementations of any of these
>relationships.  I really like Perl's current support for HAS-A:  instance
>variables.  :^)

Sure. But automatic delegation's faster than executing interpreter code to 
provide the same functionality, or it ought to be at least.

I'm not soliciting a comprehensive solution, nor even really a 
perl-specific one, but more a general "Most HAS-A situations need X, Y, and 
Z" sort of thing.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to