Reserved Word - Reserved Words and Language Independence

Reserved Words and Language Independence

Microsoft’s .NET Common Language Infrastructure (CLI) specification allows code written in 40+ different programming languages to be combined together into a final product. Because of this, identifier/reserved word collisions can occur when code implemented in one language tries to execute code written in another language. For example, a Visual Basic.NET library may contain a class definition such as:

' Class Definition of This in Visual Basic.NET: Public Class this ' This class does something... End Class

If this is compiled and distributed as part of a toolbox, a C# programmer, wishing to define a variable of type “this” would encounter a problem: 'this' is a reserved word in C#. Thus, the following will not compile in C#:

// Using This Class in C#: this x = new this; // Won't compile!

A similar issue arises when accessing members, overriding virtual methods, and identifying namespaces.

In order to work around this issue, the specification allows the programmer to (in C#) place the at-sign before the identifier which forces it to be considered an identifier rather than a reserved word by the compiler.

// Using This Class in C#: @this x = new @this; // Will compile!

For consistency, this usage is also permitted in non-public settings such as local variables, parameter names, and private members.

Read more about this topic:  Reserved Word

Famous quotes containing the words reserved, words, language and/or independence:

    From a hasty glance through the various tests I figure it out that I would be classified in Group B, indicating “Low Average Ability,” reserved usually for those just learning to speak the English Language and preparing for a career of holding a spike while another man hits it.
    Robert Benchley (1889–1945)

    We never say so much as when we do not quite know what we want to say. We need few words when we have something to say, but all the words in all the dictionaries will not suffice when we have nothing to say and want desperately to say it.
    Eric Hoffer (1902–1983)

    ...I ... believe that words can help us move or keep us paralyzed, and that our choices of language and verbal tone have something—a great deal—to do with how we live our lives and whom we end up speaking with and hearing; and that we can deflect words, by trivialization, of course, but also by ritualized respect, or we can let them enter our souls and mix with the juices of our minds.
    Adrienne Rich (b. 1929)

    Traditionally in American society, men have been trained for both competition and teamwork through sports, while women have been reared to merge their welfare with that of the family, with fewer opportunities for either independence or other team identifications, and fewer challenges to direct competition. In effect, women have been circumscribed within that unit where the benefit of one is most easily believed to be the benefit of all.
    Mary Catherine Bateson (b. 1939)