A Macaulay2 symbol is much like a function closure, in that it comes equipped with a pointer to a frame that contains a value for it. That value can be recovered with the function value, as follows.
|
|
|
The two symbols created in the example above have something in common -- they are created by the same bit of code (the function f), but they have different values.
|
|
To allow the user to determine whether two symbols are created by the same bit of code, Macaulay2 has the notion of symbol body, which parallel to the notion of function body. It's essentially the symbol, but without the pointer to the frame that contains the value.
|
|
|
All such symbol bodies are members of the class SymbolBody.
|
The object symbolBody is a compiled function.