On 1/9/08, Gabriel Dos Reis wrote:
> On Wed, 9 Jan 2008, Francois Maltey wrote:
> ...
> |
> | Suppose I test with students :
> | star (x, y) == x + y - x*y
> |
> | Then I prefer the command (x *%* y) *%* z to star (star (x, y), z)...
>
> If you use domains, you can overload + and *.
>

For example:

Create this file.

star.spad
-------------
)abbrev package STAR Star
Star(R:Ring): with
  _*:(R,R)->R
 == add
  x*y == x + y - x *$R y
-------------

In Axiom:

(1) -> )co star.spad
...
(1) -> x*y*z

   (1)  x y z
                                        Type: Polynomial Integer
(2) -> (x*y*z)$Star Polynomial Integer

   (2)  (- x y + 1)z + x y
                                        Type: Polynomial Integer

Regards,
Bill Page.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to