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

globalAssign -- global assignment, in function form

Synopsis

Description

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.