Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 7ebd25ac536d248d499a3ce2acda963a > files > 4862

Macaulay2-1.3.1-8.fc15.i686.rpm

<?xml version="1.0" encoding="utf-8" ?>  <!-- for emacs: -*- coding: utf-8 -*- -->
<!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"	 "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>override -- override default values for optional arguments</title>
<link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/>
</head>
<body>
<table class="buttons">
  <tr>
    <td><div><a href="_overview_spdocumentation_sptemplate.html">next</a> | <a href="___Output__Dictionary.html">previous</a> | <a href="_overview_spdocumentation_sptemplate.html">forward</a> | <a href="___Output__Dictionary.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div>

    </td>
  </tr>
</table>
<hr/>
<div><h1>override -- override default values for optional arguments</h1>
<div class="single"><h2>Description</h2>
<div><tt>override(defaults,args)</tt> overrides default values for optional arguments present in the argument sequence <tt>args</tt>.<p>One possibility is for the argument <tt>defaults</tt> to be an immutable hash table (of type <a href="___Option__Table.html" title="the class of hash tables for optional arguments">OptionTable</a>), and <tt>args</tt> should be a sequence of arguments, some of which are optional arguments of the form <tt>x => v</tt>.  Each such optional argument is removed from <tt>args</tt>, and the value in <tt>defaults</tt> corresponding to the key <tt>x</tt> is replaced by <tt>v</tt>.  The value returned is the modified pair <tt>(defaults, args)</tt>.  An error is signalled if the key <tt>x</tt> does not occur in <tt>defaults</tt>.</p>
<p>A second possibility is for the argument <tt>defaults</tt> to be <a href="_true.html" title="">true</a>, in which case the keys x are not checked for validity, and no default values are provided.  The main use of this is to separate the optional arguments from the other arguments, which can then be used for dispatching to the correct method.</p>
<p>This function is intended for internal use only, and is used in the processing of optional arguments for method functions that accept them.</p>
<table class="examples"><tr><td><pre>i1 : defs = new HashTable from { a => 1, b => 2 };</pre>
</td></tr>
<tr><td><pre>i2 : override(defs, (4,b=>6,5))

o2 = (HashTable{a => 1}, (4, 5))
                b => 6

o2 : Sequence</pre>
</td></tr>
</table>
</div>
</div>
</div>
</body>
</html>