Reputation: 221
I'm on a Mac and can't try it for myself right now.
For example, will this compile:
namespace 2something.something.else { }
Upvotes: 22
Views: 10769
Reputation: 49
If you really need a number in front you can write it with words
TwoSomething.something.else { }
Upvotes: 0
Reputation: 244968
No, you can't. A namespace name is an identifier and the grammar for the first character of identifiers is:
identifier_start_character
: letter_character
| '_'
;
That means that the first character has to be an underscore or a letter (including letters in non-Latin scripts, such as Arabic or Chinese).
Upvotes: 26
Reputation: 100607
You can't name a namespace starting with a number. You'll get a compiler error:
Identifier expected.
Upvotes: 4