Labelled field restrictions

Hal Daume III hdaume@ISI.EDU
Fri, 13 Sep 2002 10:03:31 -0700 (PDT)


Hi,

> there seem to be at least two choices - either the data qualifiers 
> shadow the module qualifiers, or it  is just ambiguous and the compiler 
> comlains.  i like the second one better, especially since with the "as" 
> part of the imports it is very easy to rename the module qualifiers.

there seems to be a backwards-compatibility issue if the compiler
complains on issues like this.  suppose i have "legacy" code which a
modeul T which exports a function x and then in module Y I import T
qualified by also have

    data T = T {x,y::Int}

then when I say T.x in Y, due to 'legacy-ness', this will refer to the
function x from module T, but now if the compiler starts complaining, my
code will be broken.

so it seem that the second option really isn't an option (if we're in the
mood of breaking code, i rather like Clean's foo.x method meaning (x
foo), but...)

so it seems that the only option to maintain bw compatibility would be to
have the compiler default to module-level qualification, perhaps emitting
a warning of ambiguity.  only if it is unambiguous would it use the
"new" meaning.

 - hal