[Rcpp-devel] exporting void test(void) function
Tim Keitt
tkeitt at gmail.com
Tue Dec 31 18:38:34 CET 2013
On Mon, Dec 30, 2013 at 10:36 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
>
> Hi Tim,
>
> Nice to see you here!
>
Nice to be here. Happy new year!
>
> On 30 December 2013 at 22:15, Tim Keitt wrote:
> | Apologies if this is the wrong list for user questions -- happy to be
> | redirected -- I did not see it immediately.
>
> And it is absolutely the right list: rcpp-devel as in our understanding
> 'using' of Rcpp means developing with it.
>
> | Am I correct in noting that
> |
> | // [[Rcpp::export]]
> | void test(void)
> | {
> | // do something
> | }
> |
> | does not generate any code in RcppExports.R?
>
> Yes, 'void foo(void) { ... }' is a corner case that is not well covered by
> Rcpp Attributes. At the end of the day, we always convert into 'SEXP
> .Call("foo", SEXP a, SEXP b, ...)' so the args in, result out structure is
> pretty tight.
>
> I have done 'bool foo(int ignoreme) { ... }' to work around it, or just
> returned NULLs. If you write explicit converters (maybe by manually
> postprocessing what RcppExports.cpp has) you could approximate it (by
> adding
> the require input / output args later) but the main issue is that
> Attributes
> does not do it. Maybe JJ will chime in with some comments.
>
I have
SEXP theFun(const char* ignored = "dummy")
{
// do something
return R_NilValue;
}
Wasn't sure if I'd missed something; thanks for the clarification.
THK
> Cheers, Dirk
>
> --
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
>
--
Timothy H. Keitt
http://www.keittlab.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20131231/7521a300/attachment.html>
More information about the Rcpp-devel
mailing list