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

GlobalReleaseHook

Description

GlobalReleaseHook -- a method name that is consulted when an assignment to a global variable is about to occur.

The method should be a function of two variables: the symbol to which a value is being assigned, and the old value about to be overwritten. The method should be stored under the name GlobalReleaseHook in the class of the old value. It is executed before the assignment occurs, and before the execution of GlobalAssignHook.

i1 : RR.GlobalReleaseHook = (sym,val) -> << concatenate (
          "assigning ", toString val, " to ", toString sym
          ) << endl

o1 = FunctionClosure[stdio:1:33-3:10]

o1 : FunctionClosure
i2 : a=4.5

o2 = 4.5

o2 : RR (of precision 53)
i3 : a=5.4
assigning 4.5 to a

o3 = 5.4

o3 : RR (of precision 53)

See also

For the programmer

The object GlobalReleaseHook is a symbol.