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 21:52:09 +0200 (CEST)
User-agent: SquirrelMail/1.4.3a

Hmmm, I don't say again that it should work both ways... I got misled by
SPAD. Arrrhhh. Sorry, I did not look into the sources first time.

If I am correct then we are talking about
src/algebra/efstruc.spad.pamplet.
(Gold, Silver, and build-improvements are identical)

But there I read

  goodCoef : (Vector Q, List K, SY) ->
                                 Union(Record(index:Z, ker:K), "failed")

And the original function was/is ...

    goodCoef(v, l, s) ==
      for i in minIndex v .. maxIndex v for k in l repeat
        is?(k, s) and
           ((r:=recip(qelt(v,i))) case Q) and
            (retractIfCan(r::Q)@Union(Z, "failed") case Z)
              and gdCoef?(qelt(v, i), v) => return([i, k])
      "failed"

Now, in the function below, I cannot see, that the resulting type is
matched. It looks like 'List K' is returned. As a compiler I would reject
the code below.

But of course, the compiler might think that the code below is just
ANOTHER function with another result type. Still then the compiler should
tell that

   goodCoef : (Vector Q, List K, SY) ->
                                 Union(Record(index:Z, ker:K), "failed")

is not implemented.

Or did Walter completely re-program the function (and signature)?

Ralf

> Gabriel Dos Reis wrote:
>> 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
>>
>
> This gives me the same error.  I will try to produce a self contained
> example for issue tracker.
>
> --
>                               Waldek Hebisch
> address@hidden
>
>
> _______________________________________________
> Axiom-developer mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/axiom-developer
>






reply via email to

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