Ralf,
On 7/9/07, I wrote:
...
Ralf Hemmecke wrote:
>
> It looks as if one also could do
>
> if u case MachineInteger then ...
>
> with the current Aldor compiler, I just don't know how to type
> "MachineInteger" since the compiler immediately takes the *type*
> MachineInteger and not the *tag* MachineInteger.
>
Use quotes like this?
'MachineInteger'
That makes in a member of an Enumeration. Maybe that is what Aldor expects?
..
Take a look at this example:
http://wiki.axiom-developer.org/[EMAIL PROTECTED]
#include "axiom"
macro I == Integer;
main():String == {
import from I, Float;
U == Union(Integer, Float);
import from U;
i: I := 2;
s: Float := 1.5;
ui: U := union i;
us: U := union s;
u: U := if odd? random(10) then ui else us;
if u case Integer$'Integer' then {
"Integer";
} else {
"Float";
}
}
The result is the error message:
Compiler bug...Bug: gen0UnionCaseIndex: branch not in union
The )library system command was not called after compilation.
So perhaps alll is not well...
Regards,
Bill Page
_______________________________________________
Axiom-developer mailing list
Axiom-developer@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-developer