[Aldor-l] Const Bug?
Ralf Hemmecke
ralf at hemmecke.de
Fri Aug 18 20:22:29 EDT 2006
Who can tell me whether the compiler behaves correctly when it rejects
that program below...
Removing the definitions of fooConst and barConst, compiles without a
problem.
Ralf
>aldor -laldor aaaConst.as
"aaaConst.as", line 16: nth(): Integer == 0;
................^
[L16 C17] #2 (Note 1) (cf. L21 C17)
"aaaConst.as", line 21: nth(): Integer == 1;
................^
[L21 C17] #1 (Error) Constant `nth' cannot be redefined.
(see Note 1)
---BEGIN aaaConst.as
#include "aldor"
#include "aldorio"
AAA: with == add {
foo(): Integer == {
nth(): Integer == 0;
stdout << "something" << newline;
nth();
}
bar(): Integer == {
nth(): Integer == 1;
stdout << "else" << newline;
nth();
}
fooConst: Integer == {
nth(): Integer == 0;
stdout << "something" << newline;
nth();
}
barConst: Integer == {
nth(): Integer == 1;
stdout << "else" << newline;
nth();
}
}
---END aaaConst.as
More information about the Aldor-l
mailing list