[Aldor-l] Specifying properties of functions
Martin Rubey
martin.rubey at univie.ac.at
Fri Mar 25 05:49:37 EST 2005
Dear Ralf,
one way to get it to compile is to say
define MyCommutativeRing: Category == with {MyRing; *: (%, %) -> Integer;
Commutative(%, *$%)};
however, I was unable to determine whether that would "work".
Martin
Ralf Hemmecke writes:
> Hello,
>
> In the algebra library we have something like this
>
> define CommutativeRing: Category == Ring with {...}
>
> It is implicitly understood that * is the function that "commmutative"
> refers to.
>
> A more flexible way to state properties of functions in Aldor would be
> something like this.
>
> define Commutative(D: Type, f: (D, D) -> D): Category == with;
> define MyCommutativeRing: Category == MyRing with Commutative(%, *$%);
>
> Of course, there is still a language feature missing to express,
> "f(x,y)=f(y,x)", but at least, such a property would be explicitly
> stated through a category.
>
> Unfortunately, the attached file does not compile. The compiler claim
> that it cannot figure out what * is.
>
> Does anybody know how I would have to rewrite the program so that the
> compiler accepts it?
>
> Best regards
>
> Ralf
More information about the Aldor-l
mailing list