Rename Dsymbol.namespace to cppnamespace#10287
Conversation
|
Thanks for your pull request and interest in making D better, @edi33416! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#10287" |
Wouldn't it be a better idea to handle these issues as special cases in the respective generators? If it's just C++ (and maybe C and Obj-C) keywords that we have to take special care with, it doesn't pose much of an issue, but it could quickly become one if we want to support other languages. For example, I just googled for a list of Go keywords and apparently |
Well many languages have many different kind of keywords, and some are very generic. Go's |
|
Looks like special casing other languages' keywords is more roundabout - people need to run to the manual to figure how their symbols are translated. Just going for straight generation and reasonably asking for due diligence in naming seems appropriate. |
|
Hm, thought it was approved and I just pushed "merge". If I was hasty lmk. |
Because
Dsymbol.namespaceis apublicextern (C++)symbol, the C++ header generator will generate the following codeAs you know, and see from the syntax highlight,
namespaceis a C++ keyword, so this generated code won't compile.This PR renames only the public symbol
Dsymbol.namespace.Maybe it should rename all of the
namespaceoccurrences?I think, in my humble opinion, that we should avoid using other programming languages keywords as public symbols.