Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

101 lines (97 sloc) 3.069 kB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<!-- EDIT -->
<TITLE>Mozart Standard Library: Mappings</TITLE>
<STYLE>
BODY {
background-color: white;
margin-left : 2cm;
margin-right : 2cm;
font-family : tahoma,arial,helvetica,sans-serif;
}
H1 {
text-align : center;
color : #9B0000;
}
H2 { color : #FF9933; }
H4 { color : slateblue; }
H3 { color : #881155; }
H5 { color : darkslateblue; }
CODE { color : #663366; }
CODE,TT {
font-family : "lucida console",courier,monospace;
}
CODE.DISPLAY {
display : block;
white-space : pre;
margin-left : 2cm;
margin-top : 1em;
margin-bottom : 1em;
}
P.AUTHOR {
text-align : center;
font-weight : bold;
}
SPAN.MODULE {
color : steelblue;
}
A { color : steelblue; }
SPAN.COMMENT { color: #B22222; }
SPAN.KEYWORD { color: #A020F0; }
SPAN.STRING { color: #BC8F8F; }
SPAN.FUNCTIONNAME { color: #0000FF; }
SPAN.TYPE { color: #228B22; }
SPAN.VARIABLENAME { color: #B8860B; }
SPAN.REFERENCE { color: #5F9EA0; }
SPAN.BUILTIN { color: #DA70D6; }
</STYLE>
</HEAD>
<BODY>
<!-- EDIT -->
<H1>Mappings</H1>
<P CLASS="AUTHOR">Denys Duchier</P>
<DL>
<DT><B>module</B>
<DD><SPAN CLASS="MODULE">x-oz://system/Mapping.ozf</SPAN>
</DL>
<HR>
<P>This module provides a uniform interface to standard <I>mapping</I> datatypes,
i.e. records, dictionaries and arrays
<H2>Exports</H2>
<DL>
<DT><CODE>{Mapping.get +M +Key ?Value}</CODE>
<DD>returns the <CODE>Value</CODE> associated with <CODE>Key</CODE> in
mapping <CODE>M</CODE>
<DT><CODE>{Mapping.put +M +Key +Value}</CODE>
<DD>sets the <CODE>Value</CODE> associated with <CODE>Key</CODE> in
mapping <CODE>M</CODE> (assuming the latter is mutable)
<DT><CODE>{Mapping.condGet +M +Key +Default ?Value}</CODE>
<DT><CODE>{Mapping.condSelect +M +Key +Default ?Value}</CODE>
<DD>returns the <CODE>Value</CODE> associated with <CODE>Key</CODE> in
mapping <CODE>M</CODE>, or <CODE>Default</CODE> if none
<DT><CODE>{Mapping.is +M ?B}</CODE>
<DD>returns true iff <CODE>M</CODE> is a mapping
<DT><CODE>{Mapping.isMutable +M ?B}</CODE>
<DD>returns true iff <CODE>M</CODE> is a mutable mapping
<DT><CODE>{Mapping.items +M ?L}</CODE>
<DT><CODE>{Mapping.toList +M ?L}</CODE>
<DD>returns a list of the values in the mapping
<DT><CODE>{Mapping.keys +M ?L}</CODE>
<DT><CODE>{Mapping.arity +M ?L}</CODE>
<DD>returns a list of the keys of the mapping
<DT><CODE>{Mapping.entries +M ?L}</CODE>
<DT><CODE>{Mapping.toListInd +M ?L}</CODE>
<DD>returns a list of the entries <CODE>Key#Value</CODE> in the mapping
<DT><CODE>{Mapping.clone +M1 ?M2}</CODE>
<DD>returns a clone <CODE>M2</CODE> of the mapping <CODE>M1</CODE>
<DT><CODE>{Mapping.exchange +M +Key ?Old +New}</CODE>
<DD>atomically exchanges the value for <CODE>Key</CODE> in mapping <CODE>M</CODE>:
sets it to <CODE>New</CODE> while returning <CODE>Old</CODE>
<DT><CODE>{Mapping.toRecord +Label +M ?R}</CODE>
<DD>returns a record <CODE>R</CODE> with label <CODE>Label</CODE> representing
the entries in mapping <CODE>M</CODE>
</DL>
<HR>
</BODY>
</HTML>
Jump to Line
Something went wrong with that request. Please try again.