> | Note: This code is currently the same in both FriCAS and OpenAxiom.
> 
> OpenAxiom issues this warning:
> 
>    Warnings: 
>       [1] OpenAxiom suggests removing assignment to Rep 

Very nice.

> | Since BinarySearchTree is a particular class of BinaryTree for
> | consistency in BinarySearchTree I would expect to see:
> | 
> |  Implementation == BinaryTree(S) add
> |    Rep == List Tree S

> As I said, I would not.  I would not expect any definition of Rep at
> all.   The domain extension says BinaryTree(S) is the Rep of
> BinarySearchTree(S).

In fact, in add-inherited domains

D: C == A add
     Rep == X
     ...

one should not even be allowed to ever write anything else for X than 
just A. I think Open-Axiom is right to remove the necessity of the 
(redundant line "Rep == A").

And why would one want that in Rep==X, X must be the same as A? Because 
suppose that A is defined like

A: C2 == add
     Rep == X
     ...

and for some reason you decide (as a maintainer for A) that it would be 
better to change your internal (not exported) representation from X to Y 
in an incompatible way (for example, Y=List(X)), then recompilation will 
break at compiling D, since then A and X have different underlying 
bit-layout.

Ralf

------------------------------------------------------------------------------
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to