Skip to content

Conversation

jjallaire
Copy link
Member

No description provided.

@eddelbuettel
Copy link
Member

I like it ! What was the motivation today? Leakage? Saving a cycle here or there? Drew's post?

One suggestion: a positive term ("rng") for a negative action ("do not include") is weird. Would it make sense to call it norng instead of rng?

@kevinushey
Copy link
Contributor

It seems like we default to rng = TRUE but someone could write:

// [[Rcpp::export(rng = false)]]

if so desired. Is that correct @jjallaire?

@jjallaire
Copy link
Member Author

I knew this had been asked for a few times and it's hung over my head that we didn't support it. I figured as long as I am mucking around in the attributes code I might as well just do it :-)

Kevin is correct, the default is rng = true so the only meaningful value is rng = false (which doesn't have the inversion of meaning problem you described)

@jjallaire
Copy link
Member Author

Do you think I should also support TRUE and FALSE (I currently only support true and false lowercase)

@kevinushey
Copy link
Contributor

I would say yes (I almost reflexively wrote FALSE just because I was thinking in R mode; also R provides TRUE and FALSE defines anyway so users might be accustomed to using that already.)

@jjallaire
Copy link
Member Author

Okay, I'll update to support TRUE and FALSE as well.

jjallaire added a commit that referenced this pull request Feb 12, 2015
Add rng parameter to Rcpp::export to prevent inclusion of RNGScope in generated code
@jjallaire jjallaire merged commit 7970a43 into master Feb 12, 2015
@jjallaire jjallaire deleted the feature/attributes-export-rng branch February 12, 2015 18:43
jmp75 pushed a commit to jmp75/Rcpp that referenced this pull request Mar 16, 2015
…rt-rng

Add rng parameter to Rcpp::export to prevent inclusion of RNGScope in generated code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants