[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Re: [Aldor-l] RE: Axiom domains andAldorreturntyp

From: William Sit
Subject: Re: [Axiom-developer] Re: [Aldor-l] RE: Axiom domains andAldorreturntypes
Date: Thu, 13 Jan 2005 04:30:35 -0500

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).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]