[Bug 14439] [XQuery 3.0] technical: is this a name clash?

http://www.w3.org/Bugs/Public/show_bug.cgi?id=14439

--- Comment #5 from Jonathan Robie <jonathan.robie@gmail.com> 2011-10-13 14:51:55 UTC ---
(In reply to comment #4)
> Presumably we should do some editing so that it's clearly one or the other. (I
> don't much care which.) Or would we leave it up to the implementation?

I would hate to leave it up to the implementation.

I believe the original XQuery 1.0 behavior was changed in the 2d edition, as
Mike Kay points out, this may be a matter of older text that still reflects the
original behavior.

I find this behavior a bit weird: even though the name of the variable is not
imported into the main module, the names clash. I would expect name clashes to
occur only both names are available in the same context.

(In reply to comment #4)
> But, as Michael Kay points out, the "that is, ..." elaboration doesn't cover
> this example. (Plus, it only says "should not".)

In XQuery 2ed, it did say "should not", because of concern with backwards
compatibility. Later, we decided to make this normative.

> Similarly, the section title ("Multiple Modules with the same Module URI")
> doesn't apply to this example.

True ...  

> Moreover, the "must be unique" statement doesn't supply an error code for cases
> where it's violated.

And that's definitely missing.

> So, while I agree that a processor has some justification for rejecting the
> example, I think it would also be justified in allowing the example.
> 
> Presumably we should do some editing so that it's clearly one or the other. (I
> don't much care which.) Or would we leave it up to the implementation?

I would hate to leave it up to the implementation.

My personal preference would be to say that name clashes can only occur if both
names are available in the same context. Just as private variables do not
result in name clashes, a module import only results in name clashes for names
that it actually imports. It seems strange to raise an error for a name that is
not imported.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 13 October 2011 14:51:58 UTC