[Aldor-l] exports and constants
Christian Aistleitner
tmgisi at gmx.at
Tue Jul 25 01:16:26 EDT 2006
Hello
> stdout << ( A has CatA) << newline;
> stdout << ((A add) has CatA) << newline;
>
> It still does not compile. But it should. Both A and "A add" are domains
> of type CatA.
Why should (A add) be of static type CatA? (I assume you meant static type
although has checks the dynamic type, which of course is something
different. The Aldor compiler complains about the static type of "A add".)
If (A add) had static type with {} in this context, it would be perfectly
fine for me. Nevertheless, it is a bug. Once a again a bug, where the add
statement cannot determine which static type it has to satisfy. If you
hint the compiler, it should work.
> What I wanted to demonstrate is that "A add {...}" has a type and is a
> value of its own.
>
> But if used in a context like "X: CatX == ... " it does matter whether
> there is an "add" *explicitly* appearing on the right hand side. That is
> not just an ordinary assignment of constants, i.e.
>
> constName: SomeType == somevalue;
Why not? It's just a different "somevalue".
I have not seen any code that cannot be explained by the "add is allowed
to cut off fields" principle or the "add cannot determine the type it has
to fulfill" bug.
--
Kind regards,
Christian
More information about the Aldor-l
mailing list