[Top][All Lists]

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

[Axiom-developer] Re: [Aldor-l] exports and constants

From: Christian Aistleitner
Subject: [Axiom-developer] Re: [Aldor-l] exports and constants
Date: Fri, 21 Jul 2006 09:47:16 +0200
User-agent: Opera Mail/9.00 (Linux)


> You can interpret both kinds as "provides at least".

No, I don't think that is true.

Can you provide an example where you cannot interprete it as "provides at least"?

>> Take for example
>> A: Join(CatA, CatX) == add {...}
>> B: Join(CatB, CatX) == add {...}
>> X: CatX == if odd? random() then A else B;

The reason of course is because the expression 'odd? random()'
is not static - it does not have a well-defined value at the
time that the source is compiled. It is only later when the
code is run that we can know if the condition is true or false
in a particular instance. The Aldor compiler is not able to
compile *types* of this kind.

I see, that the compiler is not able to compile this. We all agree on that. But I cannot see mhy the "odd? random()" is the problem. From my point of view, the "if" is the problem. Ralf already provided an example, where

  X: CatX == if true then (A add) else (B add);

worked, while

  X: CatX == if true then A else B;

did not. In this example "true" takes the place of "odd? random()". "true" is static as could be and still the problem remains. Therefore I doubt that "odd? random()" is the problem. Type inference across the "if" statement is the problem. As I showed in
, hinting the comiler by "@" works perfectly well.

Kind regards,

reply via email to

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