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: Ralf Hemmecke
Subject: Re: [Axiom-developer] "has" and "with" (was curious algebra failure)
Date: Mon, 13 Aug 2007 13:51:08 +0200
User-agent: Thunderbird 2.0.0.6 (X11/20070728)

| Isn't the problem whether 'Monad has SetCategory with "*":(%,%)->%' ?

If the question is formulated in terms of "has", then I think the answer
is unambiguously "yes".

Gaby, if you are going to implement "yes", then we should keep in mind that the Aldor compiler currently does not allow categories as the first argument of "has" and the AUG.pdf p.96 "Has expressions" is clear about this.

I must say, I am in favour of relaxing that to allow also categories as the first argument. The reason is a conditional export in the definition of List in LibAldor.

  l: List(PrimitiveType) := [Integer, String]

should be OK (PrimitiveType is the category that only exports
  =: (%, %) -> %
). But internally List makes conditional tests of the form

List(T:Type): ListType T == add {
  ...
  if T has PrimitiveType then {
    removeAll(t:T, l:%):% == {...}
    ...
  }
}

So giving a category as an argument to the List constructor results in a segmentation fault at runtime. The compiler does not catch that case at compile time.

In fact, I believe one should be able to distinguish domains from categories. Impossible currently with Aldor.

It seems to me that the compiler asks the question in terms of coercible,
instead of "has".

Oh, that would surprise me even in SPAD. Where should the "coerce" function come from?

Ralf




reply via email to

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