TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Metasyntactic variable beyond foo, bar, baz: quux, quux, corge, grault, garply

2 点作者 derwiki4 个月前

3 条评论

kazinator4 个月前
Foo and bar are often not metasyntactic at all, and often do not have to be substituted for real use. The only problem would be that they&#x27;re not good names in the domain where they end up.<p>A metasyntactic variable is a variable whose value is syntax. This most obviously happens in macro programming. A macro manipulates syntax, and so it is on a meta level. Typical metasyntactic variables in macros are names like expr, var, sym, body, initializer, type, ...<p>In documentation, metasyntactic variables indicate where information is to be substituted, not alternative naming. For instance: &quot;Your network-wide home directory is found at &#x2F;nfs&#x2F;atlas&#x2F;users&#x2F;$YOUR_USERID.&quot; A file system path is a kind of syntax. Symbolic indications where specific, correct forms are to be substituted from are metasyntactic.<p>Foo and bar are just example names shown in regular syntax, not in a meta syntax that transforms to regular syntax. Made up example names are not meta. Bob and Alice are not meta!<p>For instance, &quot;The simplest pattern for a C definition is: &lt;type&gt; &lt;ident&gt; = &lt;initializer&gt;;&quot;<p>Here those words in angle brackets are metasyntactic variables. The instructional text then continues:<p>&quot;For example: int foo = 2 + bar&quot;.<p>Here foo and bar are no more metasyntactic than int, + and 2! They are just example material. The act of generating an example from a syntactic pattern is a metasyntactic activity, to be sure. The resulting example is not meta though.<p>As a rule of thumb, the symbols in anything that resembles a grammar rule are metasyntactic. Symbols in a piece of syntax generated from the grammar are not, or at least not in respect to the language described by that grammar. They are an example <i>of</i> the language.
ggm4 个月前
Paris in the the spring error: should be <i>qux</i> <i>quux</i> not <i>quux</i> <i>quux</i>
zahlman4 个月前
My traditional(?) set has been foo, bar, baz, quux, spam, ni, ecky, ptong.