[Aldor-l] semantics of has

Martin Rubey martin.rubey at univie.ac.at
Fri Aug 15 10:31:05 EDT 2008


I'm very sorry, since this is meanwhile a FAQ, but I still couldn't find a
definite answer.

Stephen, I think you said at the workshop that "has" would actually check

* the explicit exports

* plus the implicit export %% (actually, one for each category from which the
  category inherits).

Now, what I do not understand: how much information does this implicit export
%% contain?  From the example below, one might come to the conclusions that
"type parameters" are implicit, while "values" aren't.

Many thanks and please bear with me.  And, of course, good luck!

Martin

#include "aldor"
#include "aldorio"

define FCat(a: Integer, T: Type): Category == with;

define FDom(a: Integer, T: Type): FCat(a, T) == add;

main(): () == {
        import from Integer, Character, TextWriter, Boolean;

        stdout << "(FDom(1, Integer) has FCat(2, Integer))@Boolean" << newline;
        stdout << (FDom(1, Integer) has FCat(2, Integer))@Boolean << newline;
        
        stdout << "(FDom(1, Integer) has FCat(1, Boolean))@Boolean" << newline; 
        stdout << (FDom(1, Integer) has FCat(1, Boolean))@Boolean << newline;           
        
        stdout << "(FDom(1, FDom(2, Integer)) has FCat(3, FDom(4, Integer)))@Boolean" << newline; 
        stdout << (FDom(1, FDom(2, Integer)) has FCat(3, FDom(4, Integer)))@Boolean << newline;
}
        
main();

martin at rubey-laptop:~/aldor-test$ aldor -Fx -laldor has.as
martin at rubey-laptop:~/aldor-test$ ./has
(FDom(1, Integer) has FCat(2, Integer))@Boolean
T
(FDom(1, Integer) has FCat(1, Boolean))@Boolean
F
(FDom(1, FDom(2, Integer)) has FCat(3, FDom(4, Integer)))@Boolean
T





More information about the Aldor-l mailing list