In order to progress I guess I should attempt to keep my reply as
short as possible, so please excuse that I have split this message
into several subjects.

On Fri, Jul 4, 2008 at 2:18 PM, Gabriel Dos Reis wrote:
> Bill Page writes:
>
> | On Fri, Jul 4, 2008 at 7:40 AM, Gabriel Dos Reis wrote:
> | > Bill Page writes:
> | >
> | > | On Thu, Jul 3, 2008 at 12:18 PM, Gabriel Dos Reis wrote:
> | >
> | >      HomogeneousAggregate(S: Type): Category ==
> | >                           ^^^^^^^
> |
> | Although Type is a domain in Aldor, exactly this sort of construction
> | is used there without a problem (notwithstanding a separate issue
> | raised by Ralf concerning the use of 'has' in Aldor). Why do you think
> | it is a problem in SPAD?
>
> What are the reasons that make you believe that it is a separate issue?
>

In Aldor I can write:

  L:List Type := [Integer,String];

with no problem but as Ralf showed

  L:List OutputType := [Integer,String];

leads to an error even though both

  Integer has OutputType and
  String has OutputType

are true.

The problem (apparently) is the definition of List:

List(T:Type): ListType T == add {
  ...
  if T has PrimitiveType then {
    ...

which compiles but is not well defined if T is a category.

In OpenAxiom we can also pass categories as parameters to List

(1) -> List IntegerNumberSystem

   (1)  List IntegerNumberSystem
                                                Type: Domain

(2) -> L:List IntegerNumberSystem:=[Integer,RomanNumeral]

   Cannot convert an element of the construct to type Any .
(2) -> [Integer,RomanNumeral]

   (2)  [Integer,RomanNumeral]
                                                Type: List Domain

(3) -> L:List Type := [Integer,RomanNumeral]

 LISP output:
(UNPRINTABLE UNPRINTABLE)
                                                Type: List Type

--------

The results here are also not so nice but at least it does not
segfault... :-). In OpenAxiom the List domain also includes
conditionals such as

      if S has ConvertibleTo InputForm then
        convert(x:%):InputForm ==
        ...

In OpenAxiom his is well-defined even if S is a category but in Aldor
there is only one form of 'has'

  domain has category

In OpenAxiom there are two forms, the above and

   category has category

The error message concerning Any above to apparently due to some other
cause. The problem with printing something of List Type (i.e. that
Type has no coerce to OutputForm since it is not a domain) has be
discussed previously.

> ...

Regards,
Bill Page.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to