[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] Re: [Aldor-l] exports and constants
From: |
Ralf Hemmecke |
Subject: |
[Axiom-developer] Re: [Aldor-l] exports and constants |
Date: |
Mon, 24 Jul 2006 23:57:29 +0200 |
User-agent: |
Thunderbird 1.5.0.4 (X11/20060516) |
On 07/24/2006 08:12 PM, Bill Page wrote:
On July 24, 2006 1:15 PM Ralf Hemmecke wrote:
...
What I wanted to demonstrate is that "A add {...}" has a type
and is a value of its own.
Hmmm... in Aldor values do not have types. "A add {...}" is
an "add expression".
OK, maybe my formulation was a bit misleading. I agree that if you look
at the memory location where a value is stored Aldor does not store type
information, but still the _compiler_ should know about the type of that
value. Same for "A add {...}". Of course that is a value since I can
assign it to a constant (or maybe even to a variable--have not tried
this), so the compiler should know its type. There are no things in
Aldor without type.
X: CatX == Dom;
and
X: CatX == Dom add;
The concept of inheritance in Aldor is obviously very important.
In an add-expression the domain appearing to the left of 'add'
is called the parent domain. This is described in the users
guide.
---BEGIN aaa12.as
#include "aldor"
#include "aldorio"
define CatA: Category == with;
define CatB: Category == with;
define CatC: Category == with;
define CatAB : Category == Join(CatA, CatB);
define CatABC: Category == Join(CatAB, CatC);
ABC: CatABC == add;
X: CatA == ABC @CatAB;
Y: CatA == (ABC add);
Z: CatA == (ABC add)@CatAB;
W: CatA == (ABC add)@CatABC;
stdout << (X has CatABC) << newline;
stdout << (Y has CatABC) << newline;
stdout << (Z has CatABC) << newline;
stdout << (W has CatABC) << newline;
---END aaa12.as
I am sure you can guess the output of the above program.
But in order to have it recorded in the mailing list, I give the output
here.
>aldor -grun -laldor aaa12.as
T
F
F
T
Please take some time to understand why for Y the answer is false but
for Z it is true. Compare that to the output for X. Is the output for W
clear?
Ralf
- [Axiom-developer] Re: [Aldor-l] exports and constants, (continued)
- [Axiom-developer] Re: [Aldor-l] exports and constants, Christian Aistleitner, 2006/07/24
- [Axiom-developer] RE: [Aldor-l] exports and constants, Bill Page, 2006/07/24
- [Axiom-developer] Re: [Aldor-l] exports and constants, root, 2006/07/24
- [Axiom-developer] RE: [Aldor-l] exports and constants, Bill Page, 2006/07/24
- [Axiom-developer] Re: [Aldor-l] exports and constants, Gabriel Dos Reis, 2006/07/24
- [Axiom-developer] Re: [Aldor-l] exports and constants, Ralf Hemmecke, 2006/07/24
- [Axiom-developer] Re: [Aldor-l] exports and constants, root, 2006/07/24
- [Axiom-developer] Re: [Aldor-l] exports and constants, Antoine Hersen, 2006/07/24
- [Axiom-developer] Re: [Aldor-l] exports and constants, Gabriel Dos Reis, 2006/07/24
- [Axiom-developer] RE: [Aldor-l] exports and constants, Bill Page, 2006/07/24
- [Axiom-developer] Re: [Aldor-l] exports and constants,
Ralf Hemmecke <=
- [Axiom-developer] RE: [Aldor-l] exports and constants, Bill Page, 2006/07/24
- [Axiom-developer] Re: [Aldor-l] exports and constants, Ralf Hemmecke, 2006/07/25
- [Axiom-developer] Re: [Aldor-l] exports and constants, Christian Aistleitner, 2006/07/25
- [Axiom-developer] Re: [Aldor-l] exports and constants, Ralf Hemmecke, 2006/07/25
- [Axiom-developer] Re: [Aldor-l] exports and constants, Christian Aistleitner, 2006/07/26
- [Axiom-developer] Re: [Aldor-l] exports and constants, Christian Aistleitner, 2006/07/25
- [Axiom-developer] Re: [Aldor-l] exports and constants, Ralf Hemmecke, 2006/07/24
[Axiom-developer] Re: [Aldor-l] exports and constants, Christian Aistleitner, 2006/07/21
[Axiom-developer] RE: [Aldor-l] exports and constants, Bill Page, 2006/07/23
[Axiom-developer] Re: [Aldor-l] exports and constants, Ralf Hemmecke, 2006/07/24