why must a NamespaceAliasDeclaration's importIdentifier not be explicitlyGlobal?

Milian Wolff mail at milianw.de
Wed Jan 19 21:06:52 UTC 2011


David Nolden, 19.01.2011:
> 2011/1/19 Milian Wolff <mail at milianw.de>:
> >> The flag could be removed in setImportIdentifier. However, when you
> >> sometimes set an import identifier _with_ the flag and sometimes
> >> _without_, then you'll be probably doing something wrong, after all
> >> the "explicitly global" should have some special meaning in your
> >> language.
> > 
> > I don't think this should be enforced, this works the same way, no:
> > 
> > namespace foobar {}
> > 
> > namespace asdf1 {
> > using namespace foobar;
> > }
> > 
> > namespace asdf2 {
> > using namespace ::foobar;
> > }
> > 
> > Here, we have once a namespace include of foobar (not global, but - since
> > no local namespace called foobar exists, maps to the global foobar). And
> > then below, more explitly, the import to ::foobar.
> > 
> > What is wrong with having two declarations with differing include imports
> > here?
> 
> In the first case, you might also be importing something else than
> 
> ::foobar, you have to do a context-dependent look-up. In the second
> 
> case, you don't really need the lookup, but you can do it too.
> 
> In both cases you import the same thing, so IMO the importIdentifier()
> should also be equal. The duchain represents the semantic after all,
> and not the syntax. Also there should be no unmeaningful differences
> in the duchain, else you open the door for new bugs depending on those
> seemingly unmeaningful differences. The choices are: Either _always_
> explicitly global, or never. I picked never.

OK, I get it. I probably just find the choice not so nice considering that it 
*must* be resolved, hence explicitly global.

Anyways, I can live with it, now that I know the reasons. Just a gotcha when 
developing a language plugin.

Bye, thanks for the answers
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20110119/340542ac/attachment.sig>


More information about the KDevelop-devel mailing list