# GlobalAssignHook -- hook for assignment to global variables

## Synopsis

• Usage:
X.GlobalAssignHook = f
• Inputs:
• X, a type
• f, , of two variables: the symbol to which a value is about to be assigned, and the value being assigned
• Consequences:
• f will be called just before an assignment to a global variable of an instance of class X occurs

## 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)