up previous next
A local alias is an alias declared inside a package, for use only
within the package. A local alias can have the same identifier as a
global alias. Only local aliases are recognized within packages.
There are two uses for local aliases. First, recall that if the
definition of function in a package uses another function, F, also
defined in the package, then F must be referred to using the package
name as a prefix or, for short, $.F
. In this way, $
, is an
automatically a local alias for the package itself. One may choose
another alias, say DD
, and write DD.F
, instead. A second use for
a local alias is to refer to a separate package. In that way, one may
refer to functions from that package inside the current package
without typing out the full package name.
Keep in mind that these aliases are used only to save typing.
Examples appear below.