On 06/18/2008 01:37 PM, Bill Page wrote:
> On 6/18/08, Ralf Hemmecke wrote:
>> ...
>> Bill Page wrote:
>>> That category that plays this role in Axiom is called Type
>>> (1) -> )sh Type
>>>  Type  is a category constructor
>> Hmmm, maybe I mix again Aldor and SPAD...
>>
>> See section 7.7 AUG:
>> Type: A type S satisfies the language-defined type Type if S is
>> the type of a domain or category. In other words, all domains
>> and categories are types.
>>
>> Is this really different for SPAD? (I am not saying anything about the
>> interpreter.)
> 
> No, I think it is the same. Both domains and categories satisfy Type, e.g.
> 
> (1) -> SetCategory has Type
> 
>    (1)  true
>                                                        Type: Boolean
> (2) -> Integer has Type
> 
>    (2)  true
>                                                        Type: Boolean

See AUG page 96:

Has expressions
A "has" expression has the following form:
     dom has cat
where dom is a domain-valued expression, and cat is a category-valued
expression.

So at least "has" is different in the Axiom interpreter or in SPAD.

%8 >> Cat:Category == with;

%11 >> Integer
   () @ Join(
PrimitiveType with
         coerce: BInt -> %
         coerce: % -> BInt
     ==  add ()
,
IntegerType with export to IntegerSegment(%)
     ==  add ()
)

%12 >> Integer has Cat
F @ Boolean

%12 >> Integer has Cat
F @ Boolean
                                            Comp: 0 msec, Interp: 160 msec
%13 >> PrimitiveType has Cat
        ^
[L18 C1] #1 (Error) No meaning for identifier `PrimitiveType'.


There is actually a hidden bug in the List constructor if it works over 
categories.

L: List OutputType := [Integer, String]

because the List constructor is defined as something like

   List(T: Type): with {
      if T has Output then ...
   } == add { ... }

and that is undefined according to the AUG if T is a category.

Ralf

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to