Skip to content

Commit 1ee6e38

Browse files
committed
deprecating loadRcppModules
- adding .Deprecate() call to function - renaming manual page - listing in new per-package Rcpp-deprecated page - updating vignette - added NEWS entry
1 parent 52a8ad0 commit 1ee6e38

File tree

9 files changed

+58
-12
lines changed

9 files changed

+58
-12
lines changed

ChangeLog

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1-
2013-05-15 Kevin Ushey <[email protected]>
1+
2016-05-06 Dirk Eddelbuettel <[email protected]>
2+
3+
* R/loadRcppModules.R (loadRcppModules): Add call to .Deprecated
4+
pointing out that loadModule is preferred
5+
* man/Rcpp-deprecated.Rd: Added to list deprecated functions
6+
* man/loadRcppModules-deprecated.Rd: Renamed to -deprecated, added link
7+
to loadModule which is the preferred method
8+
9+
* vignettes/Rcpp-modules.Rnw: Updated with respect to loadRcppModules
10+
deprecation and loadModule being preferred
11+
12+
2016-04-15 Kevin Ushey <[email protected]>
213

314
* src/attributes.cpp: Add a missing 'winslash = "/"'
415

5-
2013-05-14 J.J. Allaire <[email protected]>
16+
2016-04-14 J.J. Allaire <[email protected]>
617

7-
* src/attributes.cpp: Correct handling of dependent file paths on Windows (use winslash = "/")
18+
* src/attributes.cpp: Correct handling of dependent file paths on
19+
Windows (use winslash = "/")
820

921
2016-04-13 Dirk Eddelbuettel <[email protected]>
1022

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 0.12.4.5
4-
Date: 2016-04-15
3+
Version: 0.12.4.6
4+
Date: 2016-05-06
55
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey,
66
Qiang Kou, Douglas Bates and John Chambers
77
Maintainer: Dirk Eddelbuettel <[email protected]>

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exportMethods(prompt, show, .DollarNames, initialize, "formals<-")
1515
export(Module,
1616
Rcpp.package.skeleton,
1717
populate,
18-
loadRcppModules,
18+
loadRcppModules, # deprecated since Rcpp 0.12.5
1919
setRcppClass,
2020
loadRcppClass,
2121
loadModule,

R/loadRcppModules.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
# You should have received a copy of the GNU General Public License
1616
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
1717

18-
loadRcppModules <- function(direct=TRUE){
18+
loadRcppModules <- function(direct=TRUE) {
19+
# deprecation added May 2016, 'loadModule' has been prefered for years
20+
.Deprecated("loadModule")
21+
1922
## hunt for the namespace of the package that calls this
2023
calls <- sys.calls()
2124
w <- which( sapply( calls, function(call){

inst/NEWS.Rd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
\itemize{
2121
\item An apparent race condition in Module loading seen with R 3.3.0 was
2222
fixed (Ben Goodrich in \ghpr{461} fixing \ghit{458}).
23+
\item The (older) \code{loadRcppModules()} is now deprecated in favour of
24+
\code{loadModule()} introduced around R 2.15.1 and Rcpp 0.9.11.
2325
}
2426
}
2527
}

man/Rcpp-deprecated.Rd

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
\name{Rcpp-deprecated}
2+
\alias{Rcpp-deprecated}
3+
\title{Deprecated Functions in the Rcpp Package}
4+
\description{
5+
These functions are provided for compatibility with older versions of the
6+
\pkg{Rcpp} package only, and may be removed in future versions.
7+
}
8+
\details{
9+
\code{loadRcppModules} calls should now be replaced by
10+
\code{\link{loadModule}} calls, one per Module.
11+
}

man/loadModule.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ John Chambers
8181
\seealso{
8282
\code{\link{setRcppClass}()} to avoid the explicit call.
8383

84-
\code{\link{loadRcppModules}()} for a shotgun procedure to load all
84+
\code{\link{loadRcppModules}()} for a (deprecated) shotgun procedure to load all
8585
modules.
8686
}
8787
\examples{

man/loadRcppModules.Rd renamed to man/loadRcppModules-deprecated.Rd

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
\name{loadRcppModules}
1+
\name{loadRcppModules-deprecated}
22
\alias{loadRcppModules}
33
\title{
44
Loads Rcpp modules on package startup
55
}
66
\description{
7+
\emph{Note:} As of release 0.16.5, this function is deprecated;
8+
\code{\link{loadModule}} should be used instead.
9+
710
Function to simplify loading Rcpp modules contained in a package.
811
This function must be called from the \code{.onLoad} function of a package.
912
It uses the \code{RcppModules} field of the package \code{DESCRIPTION} file
@@ -18,7 +21,7 @@ loadRcppModules(direct=TRUE)
1821
namespace. Otherwise, the module is exposed. }
1922
}
2023
\seealso{
21-
\code{\link{populate}}
24+
\code{\link{populate}}, \code{\link{loadModule}}
2225
}
2326
\keyword{interface}
2427

vignettes/Rcpp-modules.Rnw

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,11 +908,24 @@ options( prompt = " ", continue = " " )
908908
@
909909

910910
<<eval=FALSE>>=
911-
import( Rcpp )
911+
import(Rcpp)
912912
@
913913

914+
In some case we have found that explicitly naming a symbol can be preferable:
915+
916+
<<eval=FALSE>>=
917+
import(Rcpp, evalCpp)
918+
@
919+
920+
\subsubsection{Load the module}
921+
922+
\paragraph{Deprecated older method using loadRcppModules}
923+
924+
Note: This approach is deprecated as of Rcpp 0.12.5, and now triggers a warning
925+
message. Eventually this function will be withdrawn.
926+
914927
The simplest way to load all functions and classes from a module directly
915-
into a package namespace is to use the \code{loadRcppModules} function
928+
into a package namespace used to be to use the \code{loadRcppModules} function
916929
within the \code{.onLoad} body.
917930

918931
<<eval=FALSE>>=
@@ -937,6 +950,8 @@ with a default value of \texttt{TRUE}. With this default value, all content
937950
from the module is exposed directly in the package namespace. If set to
938951
\texttt{FALSE}, all content is exposed as components of the module.
939952

953+
\paragraph{Preferred current method using loadModule}
954+
940955
Starting with release 0.9.11, an alternative is provided by the
941956
\code{loadModule()} function which takes the module name as an argument.
942957
It can be placed in any \code{.R} file in the package. This is useful as it allows to load

0 commit comments

Comments
 (0)