Martin Rubey <[EMAIL PROTECTED]> writes:

| Dear Gaby,
| 
| "Gabriel Dos Reis" <[EMAIL PROTECTED]> writes:
| 
| > The problem I had is that I wanted to use a LeftFreeModule, but only a
| > FreeModule is available.  So I decided to cook one.  That should be easy.  
In
| > addition, the lack of facility to specify `coordinates' was really very
| > annoying.  I wrote (simplifying)
| > 
| > 
| > )abbrev domain LFREEMOD LeftFreeModule
| > LeftFreeModule(R: Ring, S: OrderedSet):
| >      Join(LeftModule R, IndexedDirectProductCategory(R,S)) with
| >        linearCombination: List Pair(R,S) -> %
| >   == IndexedDirectProductAbelianGroup(R,S) add
| >     Rep == List Pair(R,S)
| 
| I think the preceding two lines are the important ones.  If you just remove
| IndexedDirectProductAbelianGroup(R,S), all works well. 

I suspect I was too dense:  before I sent out the message, I found the
problem (the two lines above as you point out), fixed it to match 
the implementation details of IndexedDirectProductAbelianGroup(R,S).
That is what put me off with respect to this particular aspect of the
semantics.  My problem isn't that after spending hours `all works
well', my problem is having to spend hours chasing my errors based on
too subtle aspects of the language.  See below for the fundamental
point that disturbs me the most.

| (I guess that this is
| not what you want, though.  You probably want to inherit some operations
| implemented in IndexedDirectProductAbelianGroup)
| 
| So, my question is: how would you interpret an operation that is inherited 
from
| IndexedDirectProductAbelianGroup(R,S), when the representations are
| incompatible as they are here?

Of course when the data layout are not right, disaster.  But, that is
beside the fundamental point.  There are many domains that do not
manipulate their representations directly.

The fundamental point is that this particular semantics seriously
inhibits  code reuse.   There is no way to extend a domain.  Spad
seems to promote copy-n-paste as way to add new domains.  That is
contrary to established software engineering practice. 

| I think, A add B is (currently) only well defined when the value of Rep in A
| and B is the same. (well, at least roughly the same.)
| 
| I admit that I do not understand (yet) why
| 
| > my `*' was not being picked if I test with R=Integer.  Rather the one from
| > IndexedDirectProductAbelianMonoid was being used, yet my coerce to 
OutputForm
| > was used for printing
| 
| I'd like to.

signature subsumption.

-- Gaby

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to