The program

#include "axiom"

extend Integer: with {
        foo: (%, %) -> %
} == add {
        foo(x: %, y: %): % == x*x + y*y;
}

compiles fine inside fricas, but I cannot use it. :-(

Does someone have an idea how to make it work?
(Yes, I want to keep the name Integer and I don't want to rewrite
integer.spad.)

Thanks in advance.

Ralf

(1) -> a: Integer := 3

   (1)  3
                                                                Type:
Integer
(2) -> b: Integer := 3

   (2)  3
                                                                Type:
Integer
(3) -> )cd ..
   The current FriCAS default directory is
      /home/hemmecke/backup/git/spadunit
(3) -> )co src/extendtst.as
   Compiling FriCAS source code from file
      /home/hemmecke/backup/git/spadunit/src/extendtst.as using
      AXIOM-XL compiler and options
-O -Fasy -Fao -Flsp -laxiom -Mno-ALDOR_W_WillObsolete -DAxiom -Y
$AXIOM/algebra -I $AXIOM/algebra
      Use the system command )set compiler args to change these
      options.
   Compiling Lisp source code from file ./extendtst.lsp
   Issuing )library command for extendtst
   Reading /home/hemmecke/backup/git/spadunit/extendtst.asy
   Integer is now explicitly exposed in frame initial
   Integer will be automatically loaded when needed from
      /home/hemmecke/backup/git/spadunit/extendtst
(3) -> a+b


   >> System error:
   The function FOAM-USER::|fiRaiseException| is undefined.

(3) -> foo(a,b)

   >> System error:
   The function FOAM-USER::|fiRaiseException| is undefined.

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to