[Top][All Lists]

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

RE: [Axiom-developer] What is SubDomain (was: non extending category)

From: Page, Bill
Subject: RE: [Axiom-developer] What is SubDomain (was: non extending category)
Date: Wed, 15 Feb 2006 05:13:10 -0500


Thank you for your comments about SubDomain. I think your
knowledge and experience as one of the original designers
of Axiom is invaluable to us. I am very happy that you are
willing to contribute to the discussion here.

On Tuesday, February 14, 2006 10:29 AM you wrote:

> Bill Page wrote:
>> ..
>> SCM: Do you happen to remember what you wrote 20 years ago? :)
> Well, not really.

It seems you remember than I do about the things I was doing
20 years ago... :)
> I do remember that I never liked SubDomain.  We had all kinds
> of special-case code to deal with it, and it was only used for
> NonNegativeInteger and PositiveInteger.  I believe the original
> motivation for sub-domains was to share implementations, but
> not categories.  So PositiveInteger could share the all the
> implementation code from Integer, but not the categories of
> Integer, since they don't form a Group under addition, for
> example.  In the end it caused a lot more work than it saved. 


I have experimented with replacing:

  == SubDomain(Integer,#1 >= 0) add

in the code for NNI by just:

  == Integer add

plus an explicit coercion from NNI to Integer and conversion
vice versa.

I think this experiment confirms your claim that the SubDomain
construct is not of much value.

> The concept of sub-domain never made it into Aldor, as far as
> I know, and that's a good thing.

If the automatic definitions of the two functions
'coerce:NNI->Integer' and 'convert:Integer->NNI' are the only
consequences of the SubDomain clause, then I guess I would
have to agree.

Bill Page.

reply via email to

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