« first day (2197 days earlier)      last day (978 days later) » 

3:10 PM
@Rcpp experts: when I receive a SEXP (say a vector) as function argument, how can I protect it in order to put it inside a XPtr wrapped class ? (I'd prefer not to clone it unless necessary)
 
 
2 hours later…
4:57 PM
Oh boy now I am really conflicted.
We had the years old schism that the R headers are (from what I can tell somewhat by historical accident) under LGPL where Section 2.1 of the R FAQ, as well as the rest of R clearly states GPL-2 or later.
And here I get a user clearly trying to end-run this.
And two minutes with Google reveal he is a manager with one of the global consultancies. I think I need to take this up at the R Foundation level.
@digEmAll Can you come to rcpp-devel with a proper question including maybe a short code example? Else just search at GitHub for XPtr and peruse?
 
@DirkEddelbuettel: sorry for the silly question... actually I read that SO q&a but I wasn't sure if Rcpp auto-PROTECT capability was valid only inside exported functions stacks or even when SEXP arguments are included inside XPtr fields... but I understand my question is too vague and maybe I can try to further search it for myself ;)
 
@digEmAll From the top of my head there is both a pair old protection macros plus a set of something newer I'd have to grep for / think about -- and of course what R itself does (doh!)
 
Protip: avoid tedious license discussions by simply pirating everything.
2
 
In fact the very question I am currently griping about with respect to the LPGL vs GPL issue discusses just that: stackoverflow.com/questions/39791553/…
@Spacedman Damn. The secret of my success is now out.
 
 
2 hours later…
7:14 PM
@DirkEddelbuettel: here's an oversimplified example of what I meant before ;) stackoverflow.com/questions/40225812/…
 
@digEmAll Have to think about this some more but I think your design may be wrong. I see XPtr as a way to get an external resource into R and making it plain to R that its memory manager has to keep its grubby hands off it. Now, starting with a SEXP and then going XPtr just feels .... upside-down and wrong. #butWhatDoIKnow
 
7:39 PM
@DirkEddelbuettel: yeah, I see what you mean, and I will think again to my design. But, in my project, I need to do some operations on large vectors using c++ (keeping a status, that's the reason of the wrapper class) and I'd prefer not to create a copy of them if possible (which will be the easiest solution in this case, e.g. storing the values inside a std::vector<double> inside the Xptr wrapped class )
 
7:56 PM
@digEmAll I'd copy. Sometimes I have even done simpler things: just create a mini-class, have one static instance in your local C++ file and pass the content in an init() call. The access as needed, and unwind at the instance at end. Simplify simplify simplify.
 
@DirkEddelbuettel mmh, yes I should probably simplify the whole stuff...but I'll leave the question open as theoretical problem :D
 

« first day (2197 days earlier)      last day (978 days later) »