[TransWarp] Addition and Recipe Order? (was Re: Components
R. David Murray
bitz at bitdance.com
Wed Jun 20 08:35:13 EDT 2001
On Wed, 20 Jun 2001, Phillip J. Eby wrote:
> Comments from the list are invited and encouraged!
Personally, I would find A + B meaning that A stuff got "added" last
*very* confusing. On the other hand, I found python base class order
a little confusing until reading this message of yours. Now that
I can think of it as a "search order", I think I'll be able to
remember it <grin>.
I really do visualize Aspect composition as a process of adding
things together, and therefore I expect that stuff added last
overlays stuff added first. This may be a result of your Transwarp
docs being the first thing I read on Aspect Programming, but even
after reading some other stuff I still visualize it that way. As
you say, it isn't a matter of first-hit lookup, it's a matter of
an active process composing things together, and that process
resulting in an output product.
I strongly favor keeping the current ordering. The ordering may
only be "logical", but it's the one I find intuitive.
In fact, if the ordering were the other way, then my intuition
would expect that B would be in place first, and that stuff from
A would be prevented from overriding it (as is the case with Python
base classes). Given that in fact the opposite is actually happening
(A is there first and B is overriding stuff), I suspect that this
mismatch between intuition and reality could lead to subtle cases
of considerable surprise in how things actually behave during
composition. I think the principle of least surprise argues for
the current ordering.
More information about the PEAK