Usage examples Metasyntactic variable
1 usage examples
1.1 c programming language
1.2 python programming language
1.3 ruby programming language
1.4 ietf request comments
usage examples
c programming language
in following example function name foo , variable name bar both metasyntactic variables. lines beginning // comments.
python programming language
spam, ham, , eggs principal metasyntactic variables used in python programming language. reference famous comedy sketch, spam, monty python, eponym of language. in following example spam, ham, , eggs metasyntactic variables , lines beginning # comments.
ruby programming language
in following example baz, foo, , bar metasyntactic variables , lines beginning # comments.
ietf request comments
both ietf rfcs , computer programming languages rendered in plain text, making necessary distinguish metasyntactic variables naming convention, since not obvious context.
plain text example:
rfc 772 (cited in rfc 3092) contains instance:
well; recipients can specified.
s: mrcp to:<foo@y> <crlf>
r: 200 ok
s: mrcp to:<raboof@y> <crlf>
r: 553 no such user here
s: mrcp to:<bar@y> <crlf>
r: 200 ok
s: mrcp to:<@y,@x,fubar@z> <crlf>
r: 200 ok
note failure of raboof has no effect on storage of
mail foo , bar or mail forwarded fubar@z
through host x .
(the documentation texinfo emphasizes distinction between metavariables , mere variables used in programming language being documented in texinfo file as: use @var command indicate metasyntactic variables. metasyntactic variable stands piece of text. example, should use metasyntactic variable in documentation of function describe arguments passed function. not use @var names of particular variables in programming languages. these specific names program, @code correct them. )
another point reflected in above example convention metavariable uniformly substituted same instance in appearances in given schema. in contrast nonterminal symbols in formal grammars nonterminals on right of production can substituted different instances.
Comments
Post a Comment