Re: [Rcpp-devel] [Bioc-devel] mzR 1.4.0 crashes R at loading

2012-11-22 Thread Dirk Eddelbuettel
On 22 November 2012 at 22:41, Steffen Neumann wrote: | Hi, | | On Thu, 2012-11-22 at 15:22 -0600, Dirk Eddelbuettel wrote: | ... | > But as soon as we change a structure or header somewhere, things potentiall | > go boom. We try to be careful, but we are also eager to get new "stuff" out. | |

Re: [Rcpp-devel] [Bioc-devel] mzR 1.4.0 crashes R at loading

2012-11-22 Thread Steffen Neumann
Hi, On Thu, 2012-11-22 at 15:22 -0600, Dirk Eddelbuettel wrote: ... > But as soon as we change a structure or header somewhere, things potentiall > go boom. We try to be careful, but we are also eager to get new "stuff" out. New stuff is great! The problem is if the ABI changes, and normal share

Re: [Rcpp-devel] [Bioc-devel] mzR 1.4.0 crashes R at loading

2012-11-22 Thread Dirk Eddelbuettel
On 22 November 2012 at 21:05, Laurent Gatto wrote: | On 22 November 2012 20:37, Steffen Neumann wrote: | > Hi, | > | > thanks Dan for fixing this. I can vaguely remember | > we've had such a problem before. | | We had this issue 6 months ago, when Rcpp 0.9.12 was released (see [1] | and commit r

Re: [Rcpp-devel] [Bioc-devel] mzR 1.4.0 crashes R at loading

2012-11-22 Thread Laurent Gatto
On 22 November 2012 20:37, Steffen Neumann wrote: > Hi, > > thanks Dan for fixing this. I can vaguely remember > we've had such a problem before. We had this issue 6 months ago, when Rcpp 0.9.12 was released (see [1] and commit r67124). > Is there any way to avoid that problem in the future ? >

Re: [Rcpp-devel] [Bioc-devel] mzR 1.4.0 crashes R at loading

2012-11-22 Thread Steffen Neumann
Hi, thanks Dan for fixing this. I can vaguely remember we've had such a problem before. Is there any way to avoid that problem in the future ? Is it that BioC needs to recompile packages when their dependencies change ? Or should we have some *maximum* Rcpp version number in the mzR dependen

Re: [Rcpp-devel] Rcpp 0.10

2012-11-22 Thread terrance savitsky
Thank you JJ and Dirk, For whatever it's worth, I had already pulled the attributes vignette and read it multiple times before making a posting. I found the vignette to be very clear until the section on working under packages. As mentioned, I had some difficulty to discern the old-to-new compar

Re: [Rcpp-devel] Dispatching based on SEXPTYPE

2012-11-22 Thread Dirk Eddelbuettel
On 22 November 2012 at 16:42, Romain Francois wrote: | Le 22/11/12 16:25, Hadley Wickham a écrit : | >> #define DISPATCH_METHOD(method, x) \ | >>switch( TYPEOF(x) ){ \ | >> case REALSXP: \ | >>return method(x);\ | >> case INTSXP:

Re: [Rcpp-devel] Dispatching based on SEXPTYPE

2012-11-22 Thread Romain Francois
Le 22/11/12 16:25, Hadley Wickham a écrit : #define DISPATCH_METHOD(method, x) \ switch( TYPEOF(x) ){ \ case REALSXP: \ return method(x);\ case INTSXP:\ return method(x); \ case STRSXP:\

Re: [Rcpp-devel] Dispatching based on SEXPTYPE

2012-11-22 Thread Hadley Wickham
> #define DISPATCH_METHOD(method, x) \ > switch( TYPEOF(x) ){ \ > case REALSXP: \ > return method(x);\ > case INTSXP:\ > return method(x); \ > case STRSXP:\ > return method(x); \ > ca

Re: [Rcpp-devel] Dispatching based on SEXPTYPE

2012-11-22 Thread JJ Allaire
> > The name of the macro should in my view giev an idea that this is meant > for vectors, e.g. DISPATCH_VECTOR_METHOD or something > +1 I was actually asking whether we should include your RcppScript as an extra utility. Does that make sense? ___ Rcpp-

Re: [Rcpp-devel] Dispatching based on SEXPTYPE

2012-11-22 Thread JJ Allaire
> > The constructor of Vector based in iterator takes care of the business. So > you don't need to write a dispatch. > > I like the idea of DISPATCH_METHOD, we would need extras at least for > RAWSXP, CPLXSXP and VECSXP . > This turned out really nice! > I have this as RcppScript now on my ~/bin

Re: [Rcpp-devel] Dispatching based on SEXPTYPE

2012-11-22 Thread Romain Francois
Got it now. With a fresh version of Rcpp (rev 4018), you can do: #include using namespace Rcpp; template SEXP unique_generic( const Vector vector ) { typedef RCPP_UNORDERED_SET< typename Vector::stored_type > SET ; SET set(vector.begin(), vector.end()); return Vector( set.begin(),

Re: [Rcpp-devel] Dispatching based on SEXPTYPE

2012-11-22 Thread Romain Francois
Le 22/11/12 13:42, JJ Allaire a écrit : Would something like this work? (Romain you probably know best whether this will actually work out over a large range of scenarios as well as if the std::string specialization would work) #include using namespace Rcpp; template RObject unique_generic(RO

Re: [Rcpp-devel] Dispatching based on SEXPTYPE

2012-11-22 Thread JJ Allaire
Would something like this work? (Romain you probably know best whether this will actually work out over a large range of scenarios as well as if the std::string specialization would work) #include using namespace Rcpp; template RObject unique_generic(RObject x) { Vector vector = as >(x);

Re: [Rcpp-devel] Inline, templates, and easy debugging

2012-11-22 Thread Romain Francois
Le 22/11/12 03:59, John Merrill a écrit : tl;dr summary -- is there a way to incorporate multiple functions into an inline call? Specifically, is there a way to include a templated function in an inline compilation? Consider the following outline: template void InsertTypedVector } RcppExport