This is an experimental feature intended to provide a workaround for the problem that the Wolfram Kernel does not always write symbol expressions with their complete context.
For example, the symbol SystemList may be written as the string "List" and not "SystemList". That means that the context of "List" is ambiguous when being read off of the link by Link::get_expr().
Link::get_expr_with_resolver() works around this problem by using a user-provided callback function to handle any ambiguous symbols. The user function can choose how to handle them. Doing this in a naive way (e.g. assuming every ambiguous symbol is in the System` context) is a hacky workaround, but sufficient for simple use-cases.
A more robust method would be to ask the Kernel explicitly for the context, e.g. by evaluating Context["List"]. But that has performance considerations, and is not easy to do in the middle of get_expr().
This is an experimental feature intended to provide a workaround for the problem that the Wolfram Kernel does not always write symbol expressions with their complete context.
For example, the symbol System
List may be written as the string "List" and not "System
List". That means that the context of "List" is ambiguous when being read off of the link byLink::get_expr()
.Link::get_expr_with_resolver() works around this problem by using a user-provided callback function to handle any ambiguous symbols. The user function can choose how to handle them. Doing this in a naive way (e.g. assuming every ambiguous symbol is in the System` context) is a hacky workaround, but sufficient for simple use-cases.
A more robust method would be to ask the Kernel explicitly for the context, e.g. by evaluating
Context["List"]
. But that has performance considerations, and is not easy to do in the middle ofget_expr()
.