Skip to main content
4 of 5
The question is now about pros and cons.
Eugene
  • 117
  • 3

Is it a good idea to let keywords have different lexical rules from names of types, variables, functions, etc?

For example, keywords have a special prefix. Objective-C has @interface, @implementation, but that's for compatibility with C. It inherits all the C keywords of course, with no @. How about a language in which all keywords are prefixed with a special character? It'll save the lexer some trivial trouble, but the programmer finally gets to use the words float, class, template ... etc.

Contrarily, C# allows @class as variable name, but that's no different from using class_.

Eugene
  • 117
  • 3