axiom-developer
[Top][All Lists]
Advanced

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

[Axiom-developer] non-reflection


From: Ralf Hemmecke
Subject: [Axiom-developer] non-reflection
Date: Thu, 27 Jul 2006 20:49:41 +0200
User-agent: Thunderbird 1.5.0.4 (X11/20060516)

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





reply via email to

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