Macaulay2 » Documentation
Packages » Macaulay2Doc :: installMethod
next | previous | forward | backward | up | index | toc

installMethod -- install methods

Description

Most users will use a different way of installing methods.

installMethod(M,f) -- installs a function f as a nullary method under the name M. This is a replacement for the syntax M () := f, which hasn't yet been made to work. As currently implemented, this is also the same as nullaryMethods#(1:M) = f.

installMethod(M,A,f) -- installs a function f as a unary method for the class A under the name M. This is the same as M A := f if M is a function. As currently implemented, this is also the same as A#M = f.

installMethod(M,A,B,f) -- installs a function f as a binary method for classes A and B under the name M. This is the same as M(A,B) := f if M is a function, or the same as A M B := f if M is a binary operator. As currently implemented, this is also the same as Y#(M,A,B) = f, where Y is the younger of A and B.

installMethod(M,A,B,C,f) -- installs a function f as a ternary method for classes A, B, and C under the name M. This is the same as M(A,B,C) := f if f is a function. As currently implemented, this is also the same as Y#(M,A,B,C) = f, where Y is the youngest of A, B, and C.

See also

For the programmer

The object installMethod is a compiled function.