[Aldor-l] extend and new domains
Ralf Hemmecke
ralf at hemmecke.de
Sat Sep 13 08:13:39 EDT 2008
>>> )abbrev domain NEWD NewD
>>> NewD():Cat(D) with ...
>>> == D add
>>> ...
>> That is (of course) not completely like "extend" since it defines a
>> *new* domain NewD instead of extending D.
> True. Aldor extend adds some kind of notion of a "local" extension,
> right? I mean that the original object code and definition prior to
> the extend is still available to someone else if they wished to extend
> it in some other contradictory manner.
I've never tried the following, but here comes how I see it.
If there is a domain D in a library A, then one can say "extend D" for a
library B1 and a library B2 that does not depend on B1. Of course, if
you then say "import from B1" and "import from B2" it is not clear which
extension is actually in scope. (I don't know what the AUG says about
this case, but I would guess, it leaved the behaviour unspecified and
thus undesireable.)
Of course, if in B2 you don't say "import from B1", but only "import
from A" and never extend D, then in B2 the domain D has only the exports
as given in A.
> So really there is also a new
> domain involved each time you extend an Aldor domain but it happens to
> have the same (overloaded) name in a given scope. Or is this
> description not very accurate?
Just play a bit with the the generated C code and you will see that
extend D: C == E add F
really creates a new domain "E add F", but that is somehow connected to
the old definition of D. At least that was my observation.
Ralf
More information about the Aldor-l
mailing list