Import

Import. expression
yields expression and is used to skip tests for a global reference within a class.
Import
may alternatively be used as an Option to Class.
  • The builtin behavior of Import is not affected.
This loads the package.
In[1]:=
Click for copyable input
By default, checks are executed during the definition of a class that emit a warning for "undeclared" symbols. The next class causes such a warning.
In[2]:=
Click for copyable input
This warning does not affect the functionality.
The symbol can be "imported" in two ways. First, it can be qualified.
In[5]:=
Click for copyable input
Second, an Import option can be used. Any option must be given after all type specifications (class name, superclass, interfaces). Each symbol can be wrapped into HoldPattern to prevent evaluation.
In[7]:=
Click for copyable input
The Import modifier becomes essential, if there is a conflict with a reference to a global symbol.
In[9]:=
Click for copyable input