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
http://lists.nongnu.org/archive/html/axiom-developer/2006-05/msg00181.html
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 http://www.aldor.org/AldorUserGuide/.
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.
Ralf
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.
_______________________________________________
Axiom-developer mailing list
Axiom-developer@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-developer