This file is indexed.

/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 &gt;&gt;</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:&nbsp;<SPAN class="string">&amp;h</SPAN>)</CODE></BLOCKQUOTE><P> We might even support several single-character abbreviations for convenience. </P><BLOCKQUOTE class="code"><CODE>help(char:&nbsp;[<SPAN class="string">&amp;h</SPAN>&nbsp;<SPAN class="string">&amp;?</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:&nbsp;<SPAN class="string">&amp;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:&nbsp;<SPAN class="string">&amp;v</SPAN>&nbsp;type:&nbsp;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:&nbsp;<SPAN class="string">&amp;q</SPAN>&nbsp;alias:&nbsp;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:&nbsp;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:&nbsp;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:&nbsp;<SPAN class="string">&amp;D</SPAN>&nbsp;type:&nbsp;atom)</CODE></BLOCKQUOTE><P> Saying </P><BLOCKQUOTE class="code"><CODE>--define=MYMACRO1&nbsp;--include=x.oz&nbsp;--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&nbsp;--define=MYMACRO1&nbsp;--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:&nbsp;<SPAN class="string">&amp;D</SPAN>&nbsp;type:&nbsp;list(atom))</CODE></BLOCKQUOTE><P> This also supports, e.&nbsp;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>&nbsp;<SPAN class="string">'YOURMACRO17'</SPAN>]&nbsp;<SPAN class="string">&quot;x.oz&quot;</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:&nbsp;<SPAN class="string">&amp;z</SPAN>&nbsp;type:&nbsp;int(min:&nbsp;0&nbsp;max:&nbsp;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:&nbsp;atom(help&nbsp;core&nbsp;outputcode<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;feedtoemulator&nbsp;dump&nbsp;executable)</CODE></BLOCKQUOTE><P> For these, <CODE>ozc</CODE> also provides the better known aliases such as: </P><BLOCKQUOTE class="code"><CODE>dump(char:&nbsp;<SPAN class="string">&amp;c</SPAN>&nbsp;alias:&nbsp;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 &gt;&gt;</A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~duchier/">Denys&nbsp;Duchier</A>, <A href="http://www.ps.uni-sb.de/~kornstae/">Leif&nbsp;Kornstaedt</A>, <A href="http://www.ps.uni-sb.de/~homik/">Martin&nbsp;Homik</A>, <A href="http://www.ps.uni-sb.de/~tmueller/">Tobias&nbsp;Müller</A>, <A href="http://www.ps.uni-sb.de/~schulte/">Christian&nbsp;Schulte</A> and&nbsp;<A href="http://www.info.ucl.ac.be/~pvr">Peter&nbsp;Van Roy</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>