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

GlobalAssignHook -- hook for assignment to global variables

Synopsis

Description

This technique is used, for example, for instances of Type and Ring to arrange for the name of the type or ring to be set to the name of the global variable to which it is first assigned. The functions globalAssignFunction and globalReleaseFunction may installed as methods for this purpose.

i1 : RR.GlobalAssignHook = (sym,val) -> << "--about to assign " << val << " to " << sym << endl;
i2 : a = 4.5
--about to assign 4.5 to a

o2 = 4.5

o2 : RR (of precision 53)

See also

For the programmer

The object GlobalAssignHook is a symbol.