Dear Franz,

I can only guess...

Franz Lehner <[EMAIL PROTECTED]> writes:

> ---BEGIN strange.as
> #include "axiom"
> 
> FPI ==> Fraction Polynomial Integer;
> 
> tfpi1(d:Polynomial Integer,n:PositiveInteger): Fraction Polynomial Integer == 
> {
>       import from Integer;
>       (1/factorial(n::Integer)^2)::FPI*d;
> }
3B
* 1 is interpreted as an Integer (because of import from Integer)

* factorial is interpreted as factorial: % -> % from Integer (again because of
  the import from Integer)

* ^ ditto

* but there is no / in Integer. I have no idea which function the compiler
  finds here. In any case:

> (4) -> tfpi1(x,3)
> Looking in Polynomial(Integer()) for ??200088  with code 250738832
> 
>      >> System error:
>      FOAM-USER::|fiRaiseException| is invalid as a function.

this looks like axiom couldn't find some function. It would be nice to know
which one, of course...

I think the following should work:

tfpi1(d:Polynomial Integer,n:PositiveInteger): Fraction Polynomial Integer == {
      import from Integer, Fraction Integer;
      (1/factorial(n::Integer)^2)::FPI*d;
}

or

tfpi1(d:Polynomial Integer,n:PositiveInteger): Fraction Polynomial Integer == {
      import from Integer;
      d/(factorial(n::Integer)^2)::(Polynomial Integer);
}

Martin



_______________________________________________
Axiom-developer mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/axiom-developer

Reply via email to