[Aldor-l] exporting a domain in aldor - another update

Martin Rubey martin.rubey at univie.ac.at
Tue Jan 2 04:04:50 EST 2007


I think I got something now. In fact, two things: a bug and a workaround.

#include "aldor"
define Cat: Category == with {
    Dom: OutputType with {
        f: () -> %;
    }
}

DomA: Cat == add {
    Dom: OutputType with {
        f: () -> %;
    } == Integer add {
        Rep == Integer;
        f(): % == per 1783;
    }
}

"works". Well, it is *very* sensitive. Under some circumstances, it seems to
work, under others, it fails. (Unfortunately, I'm on the wrong computer now, so
I can't give proper examples currently)

Furthermore, adding a Rep for DomA and exporting OutputType makes the whole
thing fail. So, the workaround is to define Dom outside of DomA and reference
it from DomA as before, i.e.,

MyCat: Category == OutputType with f: () -> %;

MyDom: MyCat == Integer add {
        Rep == Integer;
        f(): % == per 1783;
}

DomA: Cat == add {
    Dom: MyCat == MyDom;
}

I have to check this more carefully, but I think it should work. To use it from
Axiom, one has to define yet another domain constructor

getDom(D: Cat): MyCat == (Dom$D);

I hope this will work out,

Martin




More information about the Aldor-l mailing list