Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i name a C# namespace starting with a number?

Tags:

namespaces

c#

I'm on a Mac and can't try it for myself right now.

For example, will this compile:

namespace 2something.something.else { }
like image 546
gaz Avatar asked Aug 02 '11 21:08

gaz


1 Answers

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).

like image 52
svick Avatar answered Sep 26 '22 08:09

svick