I have come across the (internal) use of the function:
Internal`LocalizedBlock
I am trying to determine its purpose. It seem to behave like Internal`InheritedBlock
except that a starting value (e.g. {x = 3}
) cannot be set.
x = "global"; f[] := x
Internal`LocalizedBlock[{x}, {x, x = 7, f[], Hold[x]}]
x
Internal`InheritedBlock[{x}, {x, x = 7, f[], Hold[x]}]
x
{"global", 7, 7, Hold[x]} "global" {"global", 7, 7, Hold[x]} "global"
What purpose does this function serve? Why would it be used in place of InheritedBlock
?