[Top][All Lists]

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

Re: [Axiom-developer] Question concerning types...

From: Ralf Hemmecke
Subject: Re: [Axiom-developer] Question concerning types...
Date: Sun, 17 Sep 2006 01:43:20 +0200
User-agent: Thunderbird (X11/20060719)


On 09/16/2006 11:19 PM, Martin Rubey wrote:
C Y <address@hidden> writes:

(1) -> Q == Quaternion Fraction Integer;

Oh, I feared that this would cause trouble...

in Axiom:

Q ==> Quaternion Fraction Integer;

Well that should work, but actually I used Aldor syntax. In Axiom you would have to write

Q := Quaternion Fraction Integer;

But note then Q is a variable and could change so if you then say

P := Polynomial Q
p1: P := 1
Q := Integer
p2: P := 1

can you assure that p1=p2? Note, the have the same type P which is Polynomial Q. Or will p1 become invalid by assigning Integer to Q?

Well, typing that into Axiom will surely reveal the answer, but could you say without doing it?

Oh, I just realised some weakness of Axiom...

P := Polynomial

   Although Polynomial is the name of a constructor, a full type must
      be specified in the context you have used it. Issue )show
      Polynomial for more information.

Seems that not everything is first class... :-(

(2) -> m(a1: Q, a2: Q, a3: Q, a4: Q): Matrix Q := matrix[[a1,a2],[a3,a4]];

in Axiom and in Aldor:

m(a1: Q, a2: Q, a3: Q, a4: Q): Matrix Q == matrix[[a1,a2],[a3,a4]];

Oh yes, thank you Martin, that was a stupid mistake of mine.


reply via email to

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