/usr/share/mozart/doc/system/node5.html is in mozart-doc 1.4.0-8ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>List Examples</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node4.html">- Up -</A></TD><TD><A href="node6.html#section.application.record.examples">Next >></A></TD></TR></TABLE><DIV class="unnumbered" id="section.application.list.examples"><H3><A name="section.application.list.examples">List Examples</A></H3><P> The following will give some examples taken from the <CODE>ozc</CODE> program, which is the Oz command-line compiler. </P><DIV class="apropos"><P class="margin">Basics</P><P> The <CODE>ozc</CODE> program has a command line option to tell it to output usage information. The easiest way to specify such an option is: </P><BLOCKQUOTE class="code"><CODE>help</CODE></BLOCKQUOTE><P> Furthermore, we want to support a popular single-character abbreviation for it: </P><BLOCKQUOTE class="code"><CODE>help(char: <SPAN class="string">&h</SPAN>)</CODE></BLOCKQUOTE><P> We might even support several single-character abbreviations for convenience. </P><BLOCKQUOTE class="code"><CODE>help(char: [<SPAN class="string">&h</SPAN> <SPAN class="string">&?</SPAN>])</CODE></BLOCKQUOTE><P> We can now write any of <CODE>--help</CODE>, <CODE>-h</CODE>, or <CODE>-?</CODE> for this option. (We might also abbreviate the long form to one of <CODE>--h</CODE>, <CODE>--he</CODE>, or <CODE>--hel</CODE>, provided that this would still be unambiguous.) The returned option list would be <CODE>[help<SPAN class="keyword">#true</SPAN>]</CODE>. </P></DIV><DIV class="apropos"><P class="margin">Boolean Options</P><P> There is another option to tell <CODE>ozc</CODE> to be verbose about what it is doing. Say we specified it as follows: </P><BLOCKQUOTE class="code"><CODE>verbose(char: <SPAN class="string">&v</SPAN>)</CODE></BLOCKQUOTE><P> This means that we can write <CODE>--verbose</CODE> or <CODE>-v</CODE>. In contrast, the following specification additionally allows for <CODE>--noverbose</CODE>: </P><BLOCKQUOTE class="code"><CODE>verbose(char: <SPAN class="string">&v</SPAN> type: bool)</CODE></BLOCKQUOTE><P> </P></DIV><DIV class="apropos"><P class="margin">Aliases</P><P> Some people prefer to write <CODE>--noverbose</CODE> as <CODE>--quiet</CODE>, so we introduce an alias for it: </P><BLOCKQUOTE class="code"><CODE>quiet(char: <SPAN class="string">&q</SPAN> alias: verbose<SPAN class="keyword">#false</SPAN>)</CODE></BLOCKQUOTE><P> This is an alias with associated value. In contrast, the following option (not supported by <CODE>ozc</CODE>, by the way) would be an alias without value: </P><BLOCKQUOTE class="code"><CODE>gossipy(alias: verbose)</CODE></BLOCKQUOTE><P> This would allow us to write <CODE>--gossipy</CODE> for <CODE>--verbose</CODE> and <CODE>--nogossipy</CODE> for <CODE>--noverbose</CODE>. </P></DIV><DIV class="apropos"><P class="margin">String Arguments</P><P> The following example illustrates another type of argument than boolean: </P><BLOCKQUOTE class="code"><CODE>include(type: string)</CODE></BLOCKQUOTE><P> Saying <CODE>--include=x.oz</CODE> for instance would tell <CODE>ozc</CODE> to load and compile this file before tackling its <SPAN class="quasi">`real'</SPAN> job. Together with the following option, we get an example for when the order beween different arguments may matter: </P><BLOCKQUOTE class="code"><CODE><SPAN class="string">'define'</SPAN>(char: <SPAN class="string">&D</SPAN> type: atom)</CODE></BLOCKQUOTE><P> Saying </P><BLOCKQUOTE class="code"><CODE>--define=MYMACRO1 --include=x.oz --include=y.oz</CODE></BLOCKQUOTE><P> for instance would mean that <CODE>MYMACRO1</CODE> would be defined for both <CODE>x.oz</CODE> and <CODE>y.oz</CODE>, whereas in </P><BLOCKQUOTE class="code"><CODE>--include=x.oz --define=MYMACRO1 --include=y.oz</CODE></BLOCKQUOTE><P> it is only defined for <CODE>y.oz</CODE>. </P></DIV><P> By the way, this option has a single-character abbreviation <EM>and</EM> an explicit argument (in contrast to the implicit boolean arguments above): We can thus write either <CODE>-D MYMACRO1</CODE> or <CODE>-DMYMACRO1</CODE> instead of <CODE>--define=MYMACRO1</CODE>. </P><DIV class="apropos"><P class="margin">List Arguments</P><P> In <CODE>ozc</CODE>, actually, a list of macro names is allowed for this option: </P><BLOCKQUOTE class="code"><CODE><SPAN class="string">'define'</SPAN>(char: <SPAN class="string">&D</SPAN> type: list(atom))</CODE></BLOCKQUOTE><P> This also supports, e. g., <CODE>-DMYMACRO1,YOURMACRO17 x.oz</CODE>. This would return the option list <CODE>[<SPAN class="string">'define'</SPAN><SPAN class="keyword">#</SPAN>[<SPAN class="string">'MYMACRO1'</SPAN> <SPAN class="string">'YOURMACRO17'</SPAN>] <SPAN class="string">"x.oz"</SPAN>]</CODE>. </P></DIV><DIV class="apropos"><P class="margin">Range Limitations</P><P> Sometimes one wants to limit the range of allowed values: </P><BLOCKQUOTE class="code"><CODE>compress(char: <SPAN class="string">&z</SPAN> type: int(min: 0 max: 9))</CODE></BLOCKQUOTE><P> This would allow us to write <CODE>-z9</CODE>, but not <CODE>-z17</CODE>. For atom arguments, sometimes only a limited set of values is sensible: </P><BLOCKQUOTE class="code"><CODE>mode(type: atom(help core outputcode<BR> feedtoemulator dump executable)</CODE></BLOCKQUOTE><P> For these, <CODE>ozc</CODE> also provides the better known aliases such as: </P><BLOCKQUOTE class="code"><CODE>dump(char: <SPAN class="string">&c</SPAN> alias: mode<SPAN class="keyword">#</SPAN>dump)</CODE></BLOCKQUOTE><P> </P></DIV></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node4.html">- Up -</A></TD><TD><A href="node6.html#section.application.record.examples">Next >></A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~duchier/">Denys Duchier</A>, <A href="http://www.ps.uni-sb.de/~kornstae/">Leif Kornstaedt</A>, <A href="http://www.ps.uni-sb.de/~homik/">Martin Homik</A>, <A href="http://www.ps.uni-sb.de/~tmueller/">Tobias Müller</A>, <A href="http://www.ps.uni-sb.de/~schulte/">Christian Schulte</A> and <A href="http://www.info.ucl.ac.be/~pvr">Peter Van Roy</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|