Search code examples
c#keywordextending

How to create custom keywords C#


I'm writing a library for personal use that greatly expands C# features, and I was wondering on something quite interesting... Is it possible to create you own keywords? For example, if, foreach, for etc.

The reason I want to do this can be found at my previous question.


Solution

  • No, you can not do that. Language keywords are defined in the language definition. You could probably use the open sourced parts (compilers, etc) and create your own version of them.