
Some keywords are not reserved. They are only keywords in certain contexts. The most common and fundamental keywords are not allowed as identifiers (names). However, with extensions to the language, many new, contextual keywords have been introduced.

Contextual keywords have a special meaning, but only in a certain context (part) of your program. In this example, we assign an int of name "var". However, we also use "var" with its special meaning later ("var result"). We assign an int of name "select", but also use the special form of "select" in the query expression. The compiler is able to keep these meanings distinct.
Var ExamplesProgram that uses contextual keywords [C#]
using System;
using System.Linq;
class Program
{
static void Main()
{
int var = 1;
int select = 10;
var result = from value in Enumerable.Range(5, 5)
select value;
Console.WriteLine(var);
Console.WriteLine(select);
Console.WriteLine(result.Count());
}
}
Result
(It compiles and runs.)
Why do we need contextual keywords? Contextual keywords allowed the language developers to introduce new keywords without breaking old programs. A lot of programs probably used parameters or variables of name "select", but "select" was the perfect term for the new query expression language.
You might think that contextual keywords make it possible to use a lot more terms in your program identifiers. Why not just eliminate keywords and only use contextual keywords? This would unfortunately make programs more confusing. You could have a "var int = 1" be the same as "int var = 1". The only people who would benefit own stock in companies that sell painkillers.
Contextual keywords an important feature for languages that evolve with time or have a high level of complexity. They strike a balance between readable and simple programs, and programs that use the best terms as keywords.
Keywords