[Aldor-l] RE: Axiom domains and Aldor return types

Ralf Hemmecke hemmecke at risc.uni-linz.ac.at
Wed Jan 12 11:03:27 EST 2005


Hi Bill,

>>Foo: with { g: (n: PositiveInteger, k: PositiveInteger) -> 
>>PrimeField(n) } == add {
>>g(n: PositiveInteger, k: PositiveInteger ): PrimeField(n) ==
>> k::Integer::PrimeField(n) }              

> Ok, I will work with this example. Yes, it is better.

Well, I haven't checked whether it should really work, but
shouldn't be

Foo: with {
   g: (n: PositiveInteger, k: PositiveInteger) ->
      (P: PrimeFieldCategory, x: P)
} == add {
   g(n: PositiveInteger, k: PositiveInteger ):
    (P: PrimeFieldCategory, x:P) == {
    (PrimeField(n), k::Integer::PrimeField(n)
   }
}

be even better? The above code will not compile in Aldor, since it does 
not have PositiveInteger. And maybe it will even not compile with 
appropriate substitutions since the compiler cannot handle such a 
construction. I am, however, very much against the Any type. It is like 
building a strongly typed language and than trying to forget about 
types. For the interpreter it maybe OK, but not for the compiler.

Programming in Axiom should mean writing programs for the compiler. I 
would say that programming in the interpreter is just writing short 
scripts but not real programs.

See also
http://www.aldor.org/docs/HTML/chap23.html#10

Ralf



More information about the Aldor-l mailing list