\HeaderA{getPackageName}{The name associated with a given package}{getPackageName}
\aliasA{packageSlot}{getPackageName}{packageSlot}
\aliasA{packageSlot<\Rdash}{getPackageName}{packageSlot<.Rdash.}
\aliasA{setPackageName}{getPackageName}{setPackageName}
\keyword{programming}{getPackageName}
\begin{Description}\relax
The functions below produce the package associated with a particular
environment or position on the search list, or of the package containing a particular
function.  They are primarily used to support computations that need
to differentiate objects on multiple packages.
\end{Description}
\begin{Usage}
\begin{verbatim}
getPackageName(where)

packageSlot(object)
packageSlot(object) <- value
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{where}] The environment or position on the search list
associated with the desired package. 
\item[\code{object}] An object providing a character string name, plus the
package in which this object is to be found.
\item[\code{value}] the name of the package.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Package names are normally installed during loading of the package,
by the \LinkA{INSTALL}{INSTALL} script or by the \code{\LinkA{library}{library}}
function.  (Currently, the name is stored as the object
\code{.packageName} but don't trust this for the future.)
\end{Details}
\begin{Value}
\code{packageName} return the character-string name of the package
(without the extraneous \code{"package:"} found in the search list).

\code{packageSlot} returns or sets the package name slot (currently
an attribute, not a formal slot, but this will likely change).
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{search}{search}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## both the following usually return "base"
getPackageName(length(search()))

\end{ExampleCode}
\end{Examples}

