This file is indexed.

/usr/share/mozart/doc/base/weakdictionary.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>9.4 Weak Dictionaries</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="dictionary.html#section.chunks.dictionaries">&lt;&lt; Prev</A></TD><TD><A href="node11.html">- Up -</A></TD><TD><A href="bitarray.html#section.chunks.bitarrays">Next &gt;&gt;</A></TD></TR></TABLE><DIV id="section.chunks.weakdictionaries"><H2><A name="section.chunks.weakdictionaries">9.4 Weak Dictionaries</A></H2><P> The module <A name="label564"></A><SPAN class="index"><CODE>WeakDictionary</CODE></SPAN> contains procedures operating on weak dictionaries. A weak dictionary is much like an ordinary dictionary and supports the same API. The main difference is that an entry is kept only as long as its item (i.&nbsp;e. the value recorded under the key) has not become garbage. If the item is only reachable through one or more weak dictionaries, the corresponding entries will automatically be dropped from all weak dictionaries at the next garbage collection. </P><P class="margin">Finalization Stream</P><P> Each weak dictionary is associated with a <EM>finalization stream</EM>. When an item <CODE><I>X</I></CODE> (indexed under <CODE><I>Key</I></CODE>) becomes garbage, the entry is automatically removed from the weak dictionary at the next garbage collection and the pair <CODE>Key<SPAN class="keyword">#</SPAN>X</CODE> is sent on to the finalization stream (as if the weak dictionary were associated with a port and the pair was sent to it using <CODE>Port<SPAN class="keyword">.</SPAN>send</CODE>). This means that the item, which was garbage, becomes again non-garbage when it is sent to the finalization stream. If subsequently, this last remaining reference disappears, then the item really becomes garbage since it won't be referenced even through a weak dictionary. </P><P>The finalization stream is created at the same time as the weak dictionary; both are output arguments of <CODE>NewWeakDictionary</CODE>. If you are not interested in the finalization stream, you can explicitly close it using <CODE>WeakDictionary<SPAN class="keyword">.</SPAN>close</CODE>. </P><P>Module <CODE>WeakDictionary</CODE> can also be accessed as <CODE>Dictionary<SPAN class="keyword">.</SPAN>weak</CODE>. </P><DL><DT><A name="label565"></A><SPAN class="index"><CODE>IsWeakDictionary</CODE></SPAN> <A name="label567"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>is&nbsp;</CODE><CODE>+<I>X</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>B</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>tests whether <CODE><I>X</I></CODE> is a weak dictionary. </P></DD><DT><A name="label568"></A><SPAN class="index"><CODE>NewWeakDictionary</CODE></SPAN> <A name="label570"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>new&nbsp;</CODE><CODE>?<I>L</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>Weak</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>has the same arguments as <A href="port.html#port.new"><CODE>Port<SPAN class="keyword">.</SPAN>new</CODE></A>. Returns a new empty weak dictionary associated with a new finalization stream <CODE>L</CODE>. </P></DD><DT><CODE>close</CODE> <A name="label572"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>close&nbsp;</CODE><CODE>+<I>Weak</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>drops the finalization stream (if any). After this, any entry that becomes garbage is simply dropped instead of being sent to the finalization stream. Note that the <CODE><I>close</I></CODE>, <CODE><I>put</I></CODE>, <CODE><I>remove</I></CODE>, and <CODE><I>removeAll</I></CODE> operations cannot be used in a (subordinated) space other than where the weak dictionary has been constructed. </P></DD><DT><CODE>put</CODE> <A name="label574"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>put&nbsp;</CODE><CODE>+<I>Weak</I></CODE><CODE>&nbsp;</CODE><CODE>+<I>LI</I></CODE><CODE>&nbsp;</CODE><CODE><I>X</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>sets the item in <CODE><I>Weak</I></CODE> under key&nbsp;<CODE><I>LI</I></CODE> to&nbsp;<CODE><I>X</I></CODE>. </P></DD><DT><CODE>get</CODE> <A name="label576"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>get&nbsp;</CODE><CODE>+<I>Weak</I></CODE><CODE>&nbsp;</CODE><CODE>+<I>LI</I></CODE><CODE>&nbsp;</CODE><CODE><I>X</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns the item&nbsp;<CODE><I>X</I></CODE> of <CODE><I>Weak</I></CODE> under key&nbsp;<CODE><I>LI</I></CODE>. </P></DD><DT><CODE>condGet</CODE> <A name="label578"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>condGet&nbsp;</CODE><CODE>+<I>Weak</I></CODE><CODE>&nbsp;</CODE><CODE>+<I>LI</I></CODE><CODE>&nbsp;</CODE><CODE><I>X</I></CODE><CODE>&nbsp;</CODE><CODE><I>Y</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns the item&nbsp;<CODE><I>Y</I></CODE> of <CODE><I>Weak</I></CODE> under key&nbsp;<CODE><I>LI</I></CODE>, if <CODE><I>LI</I></CODE> is a valid key of <CODE><I>Weak</I></CODE>. Otherwise, returns&nbsp;<CODE><I>X</I></CODE>. </P></DD><DT><CODE>exchange</CODE> <A name="label580"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>exchange&nbsp;</CODE><CODE>+<I>Weak</I></CODE><CODE>&nbsp;</CODE><CODE>+<I>LI</I></CODE><CODE>&nbsp;</CODE><CODE><I>OldVal</I></CODE><CODE>&nbsp;</CODE><CODE><I>NewVal</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns the current value of <CODE><I>Weak</I></CODE> under key&nbsp;<CODE><I>LI</I></CODE> as item&nbsp;<CODE><I>OldVal</I></CODE> and updates the value of <CODE><I>Weak</I></CODE> under key&nbsp;<CODE><I>LI</I></CODE> to be <CODE><I>NewVal</I></CODE>. </P></DD><DT><CODE>condExchange</CODE> <A name="label582"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>condExchange&nbsp;</CODE><CODE>+<I>Weak</I></CODE><CODE>&nbsp;</CODE><CODE>+<I>LI</I></CODE><CODE>&nbsp;</CODE><CODE><I>DefVal</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE><I>OldVal</I></CODE><CODE>&nbsp;</CODE><CODE><I>NewVal</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>If <CODE><I>LI</I></CODE> is a valid key of <CODE><I>Weak</I></CODE> then returns the current value of <CODE><I>Weak</I></CODE> under key&nbsp;<CODE><I>LI</I></CODE> as item&nbsp;<CODE><I>OldVal</I></CODE> otherwise, returns <CODE><I>DefVal</I></CODE> as item&nbsp;<CODE><I>OldVal</I></CODE>. Sets the value of <CODE><I>Weak</I></CODE> under key&nbsp;<CODE><I>LI</I></CODE> to be <CODE><I>NewVal</I></CODE>. </P></DD><DT><CODE>keys</CODE> <A name="label584"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>keys&nbsp;</CODE><CODE>+<I>Weak</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>LIs</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns a list of all currently valid keys of <CODE><I>Weak</I></CODE>. </P></DD><DT><CODE>entries</CODE> <A name="label586"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>entries&nbsp;</CODE><CODE>+<I>Weak</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>Ts</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns the list of current entries of <CODE><I>Weak</I></CODE>. An entry is a pair <CODE><I>LI</I></CODE><CODE><SPAN class="keyword">#</SPAN></CODE><CODE><I>X</I></CODE>, where <CODE><I>LI</I></CODE> is a valid key of <CODE><I>Weak</I></CODE> and <CODE><I>X</I></CODE> the corresponding item. </P></DD><DT><CODE>items</CODE> <A name="label588"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>items&nbsp;</CODE><CODE>+<I>Weak</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>Xs</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns the list of all items currently in <CODE><I>Weak</I></CODE>. </P></DD><DT><CODE>isEmpty</CODE> <A name="label590"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>isEmpty&nbsp;</CODE><CODE>+<I>Weak</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>B</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>tests whether <CODE><I>Weak</I></CODE> currently contains an entry. </P></DD><DT><CODE>remove</CODE> <A name="label592"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>remove&nbsp;</CODE><CODE>+<I>Weak</I></CODE><CODE>&nbsp;</CODE><CODE>+<I>LI</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>removes the item under key&nbsp;<CODE><I>LI</I></CODE> from <CODE><I>Weak</I></CODE> if <CODE><I>LI</I></CODE> is a valid key. Otherwise, does nothing. </P></DD><DT><CODE>removeAll</CODE> <A name="label594"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>removeAll&nbsp;</CODE><CODE>+<I>Weak</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>removes all entries currently in <CODE><I>Weak</I></CODE>. </P></DD><DT><CODE>member</CODE> <A name="label596"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>member&nbsp;</CODE><CODE>+<I>Weak</I></CODE><CODE>&nbsp;</CODE><CODE>+<I>LI</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>B</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>tests whether <CODE><I>LI</I></CODE> is a valid key of <CODE><I>Weak</I></CODE>. </P></DD><DT><CODE>toRecord</CODE> <A name="label598"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{WeakDictionary<SPAN class="keyword">.</SPAN>toRecord&nbsp;</CODE><CODE>+<I>L</I></CODE><CODE>&nbsp;</CODE><CODE>+<I>Weak</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>R</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns a record&nbsp;<CODE><I>R</I></CODE> with label&nbsp;<CODE><I>L</I></CODE> whose features and their fields correspond to the keys and their entries of <CODE><I>Weak</I></CODE>. </P></DD></DL><P> </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="dictionary.html#section.chunks.dictionaries">&lt;&lt; Prev</A></TD><TD><A href="node11.html">- Up -</A></TD><TD><A href="bitarray.html#section.chunks.bitarrays">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> and&nbsp;<A href="http://www.ps.uni-sb.de/~schulte/">Christian&nbsp;Schulte</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>