Martin Rubey <[EMAIL PROTECTED]> writes:

[...]

| Gaby wrote:
| 
| > although it [Axiom] tends to treat operations from add-chains as if they 
were
| > from default categories or default packages (except that add-chains take
| > precedence over defaults).  So, that implies to me -- given the way defaults
| > work -- that domains can see operations overriden if used in add-chains.
| > However, newLookupInTable seems to implement that behaviour only when the
| > package is a default.  I do not know whether it is a bug of feature, but I 
do
| > want a unifrom behaviour (which tends to push the current behaviour toward a
| > bug).
| 
| I think I can live with both - and I even agree that the current (and Aldor's)
| behaviour is somewhat inconsistent.  Note that in aldor, the keyword "default"
| is used to introduce default implementations in categories.
| 
| On the practical side, it allows an optimization which I believe is quite
| important.  Without the optimization, it makes a (big) difference whether in
| IIARRAY2 you write (1)
| 
|     minRowIndex m == mnRow
|     minColIndex m == mnCol
| 
|     qelt(m,i,j) ==
|       qelt(qelt(m,i - minRowIndex m)$Rep,j - minColIndex m)
| 
| or (2)
| 
|     minRowIndex m == mnRow
|     minColIndex m == mnCol
| 
|     qelt(m,i,j) ==
|       qelt(qelt(m,i - mnRow)$Rep,j - mnCol)
| 
| 
| In fact, I'm not sure what we want.  Somehow, default implementations are a
| mixed blessing...


I sent some time thinking about this issue, pondering pros and cons,
looking at the compiler code.  My conclusion is that the existing
behaviour was a deliberate design choice to mimic `forgetful
functors'.  E.g., once one decides to reuse a domain to (partially)
implement exported operations, all relevant operations are taken from
there,  The only way to get the `object oriented' feature of virtual
functions (or non-static methods, Java parlance) is to use defaults in
categories.  This is not well (if at all!) explained in the Axiom Book.

I can see how this can be limiting in some cases, but I suspect it
makes an interesting language design choice.  A fundamental question
(to me) is: beside optimizations such as the one you want, is there
any programming technique that benefit a lot from that?

-- Gaby

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to