Look up widget in Wiktionary, the free dictionary. Widget, a character on the cartoon Wow! This disambiguation page lists title bar software definition associated with the title Widget. If an internal link led you here, you may wish to change the link to point directly to the intended article.
Did not find what they wanted? Try here
Jump to navigation Jump to search This article is about metasyntactic variables in computer science and programming. A metasyntactic variable is a specific word or set of words identified as a placeholder in computer science and specifically computer programming. 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. Metasyntactic variables are used to name entities such as variables, functions, and commands whose exact identity is unimportant and serve only to demonstrate a concept, which is useful for teaching programming. Due to English being the foundation-language, or lingua franca, of most computer programming languages these variables are commonly seen even in programs and examples of programs written for other spoken-language audiences. The typical names may depend however on the subculture that has developed around a given programming language. Metasyntactic variables used commonly across all programming languages include foobar, foo, bar, baz, qux, quux, quuz, corge, grault, garply, waldo, fred, plugh, xyzzy, and thud.
A complete reference can be found in a MIT Press book titled: The Hacker’s Dictionary. In the following example the function name foo and the variable name bar are both metasyntactic variables. Spam, ham, and eggs are the principal metasyntactic variables used in the Python programming language. Another point reflected in the above example is the convention that a metavariable is to be uniformly substituted with the same instance in all its appearances in a given schema. This is in contrast with nonterminal symbols in formal grammars where the nonterminals on the right of a production can be substituted by different instances. This section includes bits of code which show how metasyntactic variables are used in teaching computer programming concepts. Archived from the original on 2009-11-06.