axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] "has" and "with" (was curious algebra failure)


From: Bill Page
Subject: Re: [Axiom-developer] "has" and "with" (was curious algebra failure)
Date: Mon, 13 Aug 2007 14:36:56 -0400

On 8/13/07, Ralf Hemmecke wrote:
>
> You have added the Aldor version of the test code to
>
> > | http://wiki.axiom-developer.org/AnonymousCategories
>
> For test3()
>
>      -- QQ is a category-valued constant
>      define QQ:Category == with { +:(Integer,Integer)->Integer }
>      ttest3():Boolean ==
>        Integer has QQ
>
> you say:  -- should be true
>
> I don't agree with that. QQ is a (named) category (which you also could
> have defined outside. Domains belong to categories by assertion. You did
> not say
>
>    extend Integer: QQ == add;
>
> and QQ was not known before, so the aldor compiler is right to produce
> code that returns false.
>

Ok. How do tell Aldor that I do not care about the name I am only
interested in the anonymous body of a given category definition? I
thought I understood this, but I guess not. The discussion of the
'define' keyword in the AUG lead me to believe that that was what was
implied by it's use.

If I pass a category as a parameter to a constructor, e.g.

  define D: Category == with
     f: % -> %

  C(X:Category):Category == with
    if Integer has X then
      ...

  A:C(D)

does X represent the named category (D) or just it's category-value
(with f: %-> %)? Does the meaning of X change if we omitted the
'define' keyword?

Can you explain to me how I can use this? Or what to read? :-)

Regards,
Bill Page.




reply via email to

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