Sophie

Sophie

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

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>addHook(HashTable,Thing,Function) -- add a hook function to an object for later processing</title>
<link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/>
</head>
<body>
<table class="buttons">
  <tr>
    <td><div><a href="_add__Hook_lp__Symbol_cm__Function_rp.html">next</a> | <a href="_add__Hook.html">previous</a> | <a href="_add__Hook_lp__Symbol_cm__Function_rp.html">forward</a> | <a href="_add__Hook.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>addHook(HashTable,Thing,Function) -- add a hook function to an object for later processing</h1>
<div class="single"><h2>Synopsis</h2>
<ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>addHook(obj,key,hook)</tt></div>
</dd></dl>
</div>
</li>
<li><span>Function: <a href="_add__Hook.html" title="add a hook function to an object for later processing">addHook</a></span></li>
<li><div class="single">Inputs:<ul><li><span><tt>obj</tt>, <span>a <a href="___Hash__Table.html">hash table</a></span></span></li>
<li><span><tt>key</tt>, <span>a <a href="___Thing.html">thing</a></span></span></li>
<li><span><tt>hook</tt>, <span>a <a href="___Function.html">function</a></span></span></li>
</ul>
</div>
</li>
<li><div class="single">Consequences:<ul><li>the function <tt>hook</tt> is added to the beginning of the list (possibly absent) of hooks stored in <tt>obj#key</tt> if <tt>obj</tt> is mutable, or in <tt>obj.cache#key</tt> if not</li>
</ul>
</div>
</li>
</ul>
</div>
<div><!--empty documentation body--></div>
<div class="waystouse"><div class="single"><h2>Code</h2>
<pre>../../m2/methods.m2:489:56-489:125: --source code:
addHook   (HashTable,Thing,Function) := (obj,key,hook) -> (c := obj.cache; c#key = if c#?key then prepend(hook,c#key) else {hook})
../../m2/methods.m2:485:63-485:121: --source code:
addHook   (MutableHashTable,Thing,Function) := (obj,key,hook) -> obj#key = if obj#?key then prepend(hook,obj#key) else {hook}</pre>
</div>
</div>
<div class="single"><h2>See also</h2>
<ul><li><span><a href="_run__Hooks_lp__Hash__Table_cm__Thing_cm__Thing_rp.html" title="run the hook functions stored in an object">runHooks(HashTable,Thing,Thing)</a> -- run the hook functions stored in an object</span></li>
<li><span><a href="_remove__Hook_lp__Hash__Table_cm__Thing_cm__Function_rp.html" title="remove a hook function from an object">removeHook(HashTable,Thing,Function)</a> -- remove a hook function from an object</span></li>
</ul>
</div>
</div>
</body>
</html>