[Axiom-developer] Re: [Aldor-l] RE: Axiom domains andAldorreturntypes
William Sit
wyscc at cunyvm.cuny.edu
Thu Jan 13 04:30:35 EST 2005
William Sit wrote:
>
> --%Foo
> )abbrev package FOO Foo
> Foo(n:PositiveInteger, k:PositiveInteger):T==C where
> T == with
> point:()->PrimeField(n)
> C == add
> point()==k::Integer::PrimeField(n)
>
> After compiling, we can use
>
> point()$Foo(n,k)
>
> in any computation in compiler code (and in interpreter). Still can't call this
> g(n,k) unless you use a macro expansion:
>
> g(n,k)==>point()$Foo(n,k)
>
A better macro expansion is (not tested):
bar ==> point()$Foo
Then you can actually pretend bar (or point()$Foo ) is a function!
bar(n+1, 7*k+5)
is expanded (by compiler) to
point()$Foo(n+1, 7*k+5)
Can someone give an example where the *signature* of bar
bar: (n: PositiveInteger, k: PositiveInteger) -> PrimeField(n)
is actually needed?
Bill: Thanks for putting up the DynamicFunctionDomains on mathaction. However, I
was not able to edit it (rather, when I preview or save, it says "cannot find
server" after some wait).
William
More information about the Aldor-l
mailing list