<?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>installMethod -- install methods</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="___Install__Prefix.html">next</a> | <a href="_install__Hilbert__Function.html">previous</a> | <a href="___Install__Prefix.html">forward</a> | <a href="_install__Hilbert__Function.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>installMethod -- install methods</h1> <div class="single"><h2>Description</h2> <div><p/> Most users will use a different way of installing methods.<p/> <tt>installMethod(M,A,f)</tt> -- installs a function <tt>f</tt> as a unary method for the class <tt>A</tt> under the name <tt>M</tt>. This is the same as M A := f if <tt>M</tt> is a function. As currently implemented, this is also the same as <tt>A#M = f</tt>.<p/> <tt>installMethod(M,A,B,f)</tt> -- installs a function <tt>f</tt> as a binary method for classes <tt>A</tt> and <tt>B</tt> under the name <tt>M</tt>. This is the same as <tt>M(A,B) := f</tt> if <tt>M</tt> is a function, or the same as <tt>A M B := f</tt> if <tt>M</tt> is a binary operator. As currently implemented, this is also the same as <tt>Y#(M,A,B) = f</tt>, where <tt>Y</tt> is the younger of <tt>A</tt> and <tt>B</tt>.<p/> <tt>installMethod(M,A,B,C,f)</tt> -- installs a function <tt>f</tt> as a ternary method for classes <tt>A</tt>, <tt>B</tt>, and <tt>C</tt> under the name <tt>M</tt>. This is the same as <tt>M(A,B,C) := f</tt> if <tt>f</tt> is a function. As currently implemented, this is also the same as <tt>Y#(M,A,B,C) = f</tt>, where <tt>Y</tt> is the youngest of <tt>A</tt>, <tt>B</tt>, and <tt>C</tt>.<p/> </div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="__sh.html" title="length, or access to elements">#</a> -- length, or access to elements</span></li> <li><span><a href="_lookup.html" title="look up methods">lookup</a> -- look up methods</span></li> <li><span><a href="_new.html" title="new objects and new types">new</a> -- new objects and new types</span></li> </ul> </div> </div> </body> </html>