Function Repository Resource:

ContextDependencies

Source Notebook

Determine how symbols in a first context depend on symbols in a second context

Contributed by: Wolfram Staff (Wolfram Research)

ResourceFunction["ContextDependencies"]["context1`", "context2`"]

finds all definitions of symbols in context1 that depend on a symbol from context2.

Examples

Basic Examples (3) 

Set up some dependent definitions:

In[1]:=
Begin["myContext`"];
     myFunc[x_] := yourContext`yourFunc[x + 1]
     var1 = yourContext`symbol1;
End[];
Begin["yourContext`"];
     yourFunc[x_] := x^2
End[];

Get symbol dependencies linking the two contexts:

In[2]:=
ResourceFunction["ContextDependencies"]["myContext`", "yourContext`"]
Out[2]=

Get symbol dependencies in the other direction:

In[3]:=
ResourceFunction["ContextDependencies"]["yourContext`", "myContext`"]
Out[3]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 22 February 2019

Related Resources

License Information