next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Macaulay2Doc :: globalAssign

globalAssign -- global assignment, in function form



This function mimics what happens in the interpreter when an assignment to a global variable occurs, and can be useful if the name of the symbol is not known when the code is written. If the value changes, then GlobalReleaseHook and GlobalAssignHook are called appropriately.

i1 : x = y

o1 = y

o1 : Symbol
i2 : globalAssign(x,4)

o2 = 4
i3 : x

o3 = y

o3 : Symbol
i4 : y

o4 = 4

For the programmer

The object globalAssign is a function closure.