[Aldor-l] export from ...

Ralf Hemmecke ralf at hemmecke.de
Thu Dec 7 16:07:27 EST 2006


Via

aldor -gloop
#include "aldor"
MachineInteger

one finds among the export of MachineInteger a line

         export to IntegerSegment(%)

which means that whenever I say

   import from MachineInteger

also the exports of IntegerSegment(MachineInteger) are available.

But what about the following code?

---BEGIN aaa.as
#include "aldor"
extend MachineInteger: with {elements: () -> Generator %} == add {
#if WITHSEGMENT
	import from IntegerSegment %;
#endif
         elements(): Generator % == generate {
                 for i: MachineInteger in 1 .. repeat yield i;
         }
}
---END aaa.as

woodpecker:~/scratch>aldor -DWITHSEGMENT aaa.as
woodpecker:~/scratch>aldor aaa.as
"aaa.as", line 7:
                 for i: MachineInteger in 1 .. repeat yield i;
...........................................^
[L7 C44] #1 (Error) There are no suitable meanings for the operator `..'.

I would have expected that "import from IntegerSegment" were unnecessary 
in that case.

Unfortunately, I cannot find anything about this case in the Aldor User 
Guide. So the question is, whether the compiler behaves correctly here. 
What does the language specification require?

Thanks in advance

Ralf



More information about the Aldor-l mailing list