Skip to content

Commit fa58dc2

Browse files
committed
new Rcpp-FAQ answer was added regarding fixed-argument size (cf #435)
1 parent b592d80 commit fa58dc2

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2016-02-16 Dirk Eddelbuettel <[email protected]>
2+
3+
* vignettes/Rcpp-FAQ.Rnw: Added answer on fixed-size limit of arguments
4+
15
2016-02-07 Dirk Eddelbuettel <[email protected]>
26

37
* R/Attributes.R (sourceCppFunction): Use fully matched seq(along.with=...)

inst/NEWS.Rd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
packages for vignette building (\ghit{422}).
3131
\item Use on OS X was further detailed (James Balamuta in \ghpr{433} with
3232
further review by Bob Rudis).
33+
\item An entry was added concerning the hard-code limit of arguments to
34+
some constructor and function (cf \ghit{435}).
3335
\item The Rcpp-FAQ now contains a table of content.
3436
}
3537
}

vignettes/Rcpp-FAQ.Rnw

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,24 @@ Specific per-platform notes:
11631163
Fedora and other distributions should have similar packages.
11641164
\end{description}
11651165

1166+
\subsection{Why is there a limit of 20 on some constructors?}
1167+
1168+
\begin{quote}
1169+
\emph{Ok, I would like to pass $N$ object but you only allow 20. How come?}
1170+
\end{quote}
1171+
1172+
In essence, and in order to be able to compile it with the largest number of
1173+
compilers, \pkg{Rcpp} is constrained by the older C++ standards which do not
1174+
support variadic function arguments. So we actually use macros and code
1175+
generator scripts to explicitly enumerate arguments, and that number has to stop
1176+
at some limit. We chose 20.
1177+
1178+
A good discussion is available at
1179+
\href{http://stackoverflow.com/questions/27371543}{this StackOverflow question}
1180+
concering data.frame creation with \pkg{Rcpp}. One solution offers a custom
1181+
\code{ListBuilder} class to circumvent the limit; another suggests to simply
1182+
nest lists.
1183+
11661184

11671185
\section{Support}
11681186

@@ -1245,11 +1263,12 @@ Yes. Just send us an email.
12451263

12461264
From late 2008 to late 2013, we used the
12471265
\href{https://r-forge.r-project.org/scm/?group_id=155}{Subversion repository at R-Forge}
1248-
which contained Rcpp and a number of related packages. It still has the full
1266+
which contained \pkg{Rcpp} and a number of related packages. It still has the full
12491267
history as well as number of support files.
12501268

12511269
We have since switched to a \href{http://github.com/RcppCore/Rcpp}{Git
1252-
repository at Github} for Rcpp (as well as for RcppArmadillo and RcppEigen).
1270+
repository at Github} for \pkg{Rcpp} (as well as for \pkg{RcppArmadillo} and
1271+
\pkg{RcppEigen}).
12531272

12541273
\bibliographystyle{plainnat}
12551274
\bibliography{Rcpp}

0 commit comments

Comments
 (0)