[Top][All Lists]

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

[Axiom-developer] Re: [Aldor-l] [Axiom-math] Are Fraction and Complex do

From: Ralf Hemmecke
Subject: [Axiom-developer] Re: [Aldor-l] [Axiom-math] Are Fraction and Complex domains.
Date: Mon, 15 May 2006 03:36:11 +0200
User-agent: Thunderbird (X11/20060420)

Please, guys explain clearly you're after.

Trying to clarify what the Aldor compiler does and what it should do.

I do not take the compiler's behaivour as "God given".

Of course.

I need clear semantics.

Of course. But what Christian's program from

does is to exhibit a bug either in the Aldor compiler or the documentation. I don't think that one can find any better documentation than Section 7.3 "Type context" in

Interestingly, if the documentation where better, I would even say that despite the lines

local a == inc NUM;
local b == inc dec inc NUM;
stdout << "a              : "; stdout << f()$Dom(a); stdout << newline;
stdout << "b              : "; stdout << f()$Dom(b); stdout << newline;

give different output in Christian's program, the compiler still behaves functional. The problem is that the documentation should be more precise of what "a equals b" in the above context actually means.

If we replace Integer by TextWriter in Christian's program and do something like

stdout << f()$Dom(stdout);
stdout << f()$Dom(stderr);

of course most people would say that it is clear that the output might be different because

"stdout is not equal to stderr".                                 (*)

But how can one say that? stdout and stderr are of type TextWriter and that type does not export any equality. So the only chance one has to give meaning to (*) is to mean pointer equality. I cannot remember that I have ever read this in the Aldor User Guide.

> If you're after a non-functional type system, please explain
clearly what they are useful for, with clear examples.  Explain also
how one reasons with such type system, how one writes relaible program
with such a type system.

I, for my part, did never claim that I want a non-functional type system. I actually learned through this thread that a functional one would be a good thing.

I am sure you could give a reference to illustrative examples that show serious problems. Not everyone has studied those things in his/her career.


PS: Apart from clarification of functionality of the type system Christian's program also shows that its behaviour depends on the implementation of AldorInteger. One might get different results on 32 and 64 bit machines. It's already interesting that one has to take quite big integers to make a and b into "different" things.

reply via email to

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