Hello Bill,

This same program using a List data structure instead of a
Generator compiles (almost):

I have shortened your program a bit. So now it is no longer about reflections.

--- BEGIN: aaa13.as
#include "aldor"
#include "aldorio"

exports: List Category == [
    with {+:(%, %) -> %},
    with {foo:(%, %) -> %},
    with {-: % -> %}
];

default sig: Category;
for sig in exports repeat {
        cat: Category == sig;
        stdout << (Integer has cat) << newline;
}
---END aaa13.as

That compiles and runs, but the output is not as you would expect given the fact that Integer surely as such an addition.

>aldor -grun -laldor aaa13.as
F
F
F

And it even does not help if you say

   define cat: Category == with sig;

Note however, that I define (and redefine a constant inside the loop body. Using == inside loop bodies has once been told to me by an Aldor developer from NAG, but I am not sure that I understand what the scope of cat is.

You can add a line

stdout << (SingleFloat has cat) << newline;

after the for loop. And this gives just another F as output.

Ralf



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

Reply via email to