In the strict sense of the term, metasyntactic variable, in computer science, is a placeholder name or an alias term commonly used to denote an arbitrary thing, or an arbitrary member of a class of things under discussion, i.e. a metavariable. The word foo as used in IETF RFCs is a good example. By mathematical analogy, a metasyntactic variable is a word that is a variable for other words, just as in algebra letters are used as variables for numbers. Any symbol or word which does not violate the syntactic rules of the language can be used as a metasyntactic variable. For specifications written in natural language, nonsense words are commonly used as metasyntactic variables.
In hacker culture, "metasyntactic variable" has come denote some typical (otherwise meaningless) words used as metavariables in computing; see reification. For example, The Hacker's Dictionary (1st ed.) defined FOO as "the first metasyntactic variable" and BAR as "the second metasyntactic variable", explaining that "When you have to invent an arbitrary temporary name for something for the sake of exposition, FOO is usually used. If you need a second one, BAR or BAZ is usually used; there is a slight preference at MIT for bar and at Stanford for baz. Clearly, bar was the original, for the concatenation FOOBAR is widely used also, and this in turn can be traced to the obscene acronym “FUBAR” that arose in the armed forces during World War II. A hacker avoids using “foo” as the real name of anything. Indeed, a standard convention is that any file with “foo” in its name is temporary and can be deleted on sight." The names of these consecrated "metasyntactic variables" are also commonly used as actual identifiers (for variables, functions, etc.) in tutorial programming examples when their purpose is to emphasize syntax; in this usage, "metasyntactic variable" is synonymous with "meaningless word".
Read more about Metasyntactic Variable: Construction, Examples
Famous quotes containing the word variable:
“There is not so variable a thing in nature as a ladys head-dress.”
—Joseph Addison (16721719)