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 ClassIf 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#:
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:
“Wandering stars, to whom is reserved the blackness of darkness for ever.”
—Bible: New Testament Jude, verse 13.
Recalling the Book of Enoch, in which fallen angels were condemned to be stars.
“I am filling the room
with the words from my pen.
Words leak out of it like a miscarriage.
I am zinging words out into the air
and they come back like squash balls.
Yet there is silence.”
—Anne Sexton (19281974)
“He had not failed to observe how harmoniously gigantic language and a microscopic topic go together.”
—Mark Twain [Samuel Langhorne Clemens] (18351910)
“In a famous Middletown study of Muncie, Indiana, in 1924, mothers were asked to rank the qualities they most desire in their children. At the top of the list were conformity and strict obedience. More than fifty years later, when the Middletown survey was replicated, mothers placed autonomy and independence first. The healthiest parenting probably promotes a balance of these qualities in children.”
—Richard Louv (20th century)