axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Nested functions in SPAD


From: hemmecke
Subject: Re: [Axiom-developer] Nested functions in SPAD
Date: Sat, 7 Oct 2006 16:24:18 +0200 (CEST)
User-agent: SquirrelMail/1.4.3a

> Waldek Hebisch <address@hidden> writes:
>
> | How to correctly define nested function in algebra file?  I changed
> | beggining of goodCoef (in efstruc.spad.pamphlet) to the following:
> |
> |     goodCoef(v, l, s) ==
> |       -- if k1 is part of k2 we should not express k1 in terms of k2
> |       -- (othewise we would get infinite recursion)
> |       -- below we impose a stronger condition: we require
> |       -- height(k1) to be maximal
> |       h:NonNegativeInteger := 0
> |       j:Integer := 0
> |       transcendental?(k:K):Boolean ==
> |          is?(k, "log"::SY) => true
> |          is?(k, "exp"::SY) => true
> |          is?(k, "tan"::SY) => true
> |          is?(k, "atan"::SY) => true
> |          false
> |       ll := [k for k in l | transcendental?(k)]
> |
> | that compiles OK, but at runtime I get:
> |
> |    >> System error:
> |    The function |EFSTRUC;transcendental?| is undefined.
>
> Try:
>     goodCoef(v, l, s) ==
>       -- if k1 is part of k2 we should not express k1 in terms of k2
>       -- (othewise we would get infinite recursion)
>       -- below we impose a stronger condition: we require
>       -- height(k1) to be maximal
>       h:NonNegativeInteger := 0
>       j:Integer := 0
>       ll := [k for k in l | transcendental?(k)] where
>          transcendental?(k:K):Boolean ==
>             is?(k, "log"::SY) => true
>             is?(k, "exp"::SY) => true
>             is?(k, "tan"::SY) => true
>             is?(k, "atan"::SY) => true
>             false
>       ll
>
> -- Gaby

Interesting. Both should work.

Ralf





reply via email to

[Prev in Thread] Current Thread [Next in Thread]