[email protected] (Page, Bill) writes:
> We are talking about categories here, so this does not have
> any effect on the Axiom interpreter. Every function that the
> interpreter calls in located in some package or domain and
> if necessary the function can be selected based on the package
> or domain name.
This is not true. Don't forget about default functions, for example powering in
the case of monoids!
Martin
PS: The more I think of it, the better I find the proposed solution of passing
the appropriate functions to the category. For example, along the following
lines. Of course, this code does *not* work currently. Rather, it is a proposal
for a possible extension of Aldor.
-------------------------------------------------------------------------------
)abbrev category MYMON MyMonoid
MyMonoid(m: (%,%)->%): Category == with
square: % -> %
add
square a == m(a,a)
)abb domain WORD Word
Word: Exports == Implementation where
Exports == with
coerce: String -> %
c: (%, %) -> %
MyMonoid(c) -- in case of several different operations "c", we would need
-- to provide the full signature, of course.
Implementation == add
Rep := String
coerce(a: String): % == a
c(a, b) == concat(a::Rep, b::Rep)
-------------------------------------------------------------------------------
This "solution" has two advantages:
* we don't need any new syntax
* it also deals with the problem of implementing axioms, for example,
"commutative" would simply be a category - without any exports.
I wonder whether this would be difficult to implement.
Martin
_______________________________________________
Axiom-developer mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/axiom-developer