axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] Bug?


From: Bill Page
Subject: Re: [Axiom-developer] Bug?
Date: Thu, 29 Mar 2007 17:21:52 -0400
User-agent: Webmail 4.0

Quoting Ralf Hemmecke <address@hidden>:

...
On
http://wiki.axiom-developer.org/SandBoxDomainNotValid
you'll find the construction with the macro instead of the category.

a: CI := new(2, 1)
    Complex2 Integer is not a valid type.


Axiom says Complex2(Integer) is not valid because it thinks Integer
does not satisfy the category which you denoted by the macro MyRing.

macro MyRing == with
    0: %
    -: % -> %
    -: (%,%) -> %
    +: (%,%) -> %
    *: (%,%) -> %
    coerce: % -> OutputForm

But Integer has Ring so if you add 3 new functions to Complex2,  1, =
and characteristic() then both Integer and Complex2 can satisfy Ring.
See my revised code here:

http://wiki.axiom-developer.org/SandBoxDomainNowValid

Interestingly, if one really expends the macro by hand, then Aldor
allows a construction of the form

A: with {foo: % -> %} with == add {...}

Well, it looks weird, but I think the language definition doesn't forbid
that.


You are right that this is valid Aldor code even if you use the macro.
That is not the problem. The actual problem is that you are trying
to use what in Aldor is called an anonymous category, i.e. a category
with no real name (The macro name is not the name of a category,
it is only the name of some string of characters.) in the Axiom interpreter.
Apparently the interpreter does not understand how to evaluate Aldor
anonymous categories.

I guess once Aldor becomes open source we could classify this as
a bug. :-)

Regards,
Bill Page.






reply via email to

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