The current way this function works is by storing the string used for printing under X.name and storing the global variable under X.symbol.
Another thing done by this function is to apply use to the thing. This is used for polynomial rings to assign values to the symbols representing the variables (indeterminates) in the ring.
i1 : X = new Type of MutableHashTable |
i2 : x = new X |
i3 : GlobalAssignHook X := globalAssignFunction |
i4 : GlobalReleaseHook X := globalReleaseFunction |
i5 : x' = new X |
i6 : t = {x,x'} |
i7 : x = x' = 44 |
i8 : t |
i9 : code globalAssignFunction |
See also name, symbol, and SelfInitializingType.