Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers generated from interfaces uses invalid C++ when exported name has dot #402

Closed
jackwasey opened this issue Nov 24, 2015 · 5 comments
Closed

Comments

@jackwasey
Copy link
Contributor

@jackwasey jackwasey commented Nov 24, 2015

The attributes vignette describes how to name a function using
// [[Rcpp:export(name="something.dot")]]
allowing use of . prefix or S3 methods. However, when
// [[Rcpp::interfaces(r, cpp)]]
is used, the generated header file uses the exported name (perhaps correctly), but when an S3 method is exported, the header includes things like:

    inline List rcpp.dot() {
      typedef SEXP(*Ptr_rcpp.dot)();

which don't compile.

To replicate:

Rcpp.package.skeleton()

Then change the attributes in src/rcpp_hello_world.cpp to:

// [[Rcpp::interfaces(r, cpp)]]
// [[Rcpp::export(name="rcpp.dot")]]

Then attempt to compile. I used devtools::load_all(). Without // [[Rcpp::interfaces(r, cpp)]] it compiles fine.

@eddelbuettel
Copy link
Member

@eddelbuettel eddelbuettel commented Nov 25, 2015

That puts a second issue on @jjallaire 's plate...

@jjallaire
Copy link
Member

@jjallaire jjallaire commented Nov 25, 2015

PR with a fix is here: #403

On Tue, Nov 24, 2015 at 7:54 PM, Dirk Eddelbuettel <notifications@github.com

wrote:

That puts a second issue on @jjallaire https://github.com/jjallaire 's
plate...


Reply to this email directly or view it on GitHub
#402 (comment).

@eddelbuettel
Copy link
Member

@eddelbuettel eddelbuettel commented Nov 25, 2015

Lovely, thank you!

@jackwasey
Copy link
Contributor Author

@jackwasey jackwasey commented Nov 26, 2015

Lightning fast as always. Thanks.

@eddelbuettel
Copy link
Member

@eddelbuettel eddelbuettel commented Nov 26, 2015

That's Rcpp's slogan, isn't it? ;-)

eddelbuettel added a commit that referenced this issue Nov 27, 2015
mentions #404, #362, #403, #402, #400, #278
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.