Re: [Rcpp-devel] Rcpp-modules trouble on windows

2015-10-27 Thread Dmitriy Selivanov
Finally I caught this issue. My bad - I used `.property` instead of `.method` in RCPP_MODULE macro for function call (forgot to adjust it when changed underlying c++ code). 2015-10-22 11:01 GMT+03:00 Dmitriy Selivanov : > Hi, mailing list! > I have issue with Rcpp modules on *windows only* (don

Re: [Rcpp-devel] Rcpp modules and S3 dispatch on rbind/cbind

2015-01-14 Thread Dirk Eddelbuettel
On 14 January 2015 at 15:00, Louis Aslett wrote: | Sorry hit send prematurely | | Just for the list record I think I've figured this out. It turns out | that there is an S4 approach to this now, whereby one actually sets Sweet, and well done. I had meant to reply and suggest something li

Re: [Rcpp-devel] Rcpp modules and S3 dispatch on rbind/cbind

2015-01-14 Thread Louis Aslett
Sorry hit send prematurely Just for the list record I think I've figured this out. It turns out that there is an S4 approach to this now, whereby one actually sets appropriate methods for the rbind2 and cbind2 functions in the methods package and then call: methods:::bind_activation(on = TR

Re: [Rcpp-devel] Rcpp modules and S3 dispatch on rbind/cbind

2015-01-14 Thread Louis Aslett
Just for the list record I think I've figured this out. It turns out that there is an S4 approach to this now, whereby one actually sets appropriate methods for the rbind2 and cbind2 functions in the methods package and then call: On 12 January 2015 at 13:44, Louis Aslett wrote: > I've encounte

Re: [Rcpp-devel] Rcpp modules and return_value_policy for exposed C++ member functions

2014-11-10 Thread Dirk Eddelbuettel
On 10 November 2014 at 16:51, Claymore Marshall wrote: | Thank you for the feedback Dirk.  Fair enough. | | I think the issue I have is similar to this (I want to set  StoragePolicy = | false for the XPtr), so I sort of have a work around going: http:// | lists.r-forge.r-project.org/pipermail/rcp

Re: [Rcpp-devel] Rcpp modules and return_value_policy for exposed C++ member functions

2014-11-10 Thread Claymore Marshall
Thank you for the feedback Dirk. Fair enough. I think the issue I have is similar to this (I want to set StoragePolicy = false for the XPtr), so I sort of have a work around going: *http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2013-February/005273.html

Re: [Rcpp-devel] Rcpp modules and return_value_policy for exposed C++ member functions

2014-11-10 Thread Dirk Eddelbuettel
On 10 November 2014 at 13:16, Claymore Marshall wrote: | I want to expose to R several C++ classes from a library with Rcpp modules.  | I'm trying to imitate a similar set of Python modules that were made for the | same library. | | In Boost.Python, with .def it is possible to specify the return_

Re: [Rcpp-devel] [Rcpp Modules] Static functions

2013-05-09 Thread Romain Francois
This is not supported currently. It might be in the future when someone finds time or funding. One thing that could be done is to create a simple wrapper function around it and expose this with the module. You wont get the associarion with the class though. double wrapper_myFunction(){ r

Re: [Rcpp-devel] Rcpp modules and parsing an object back and forth between R & C++

2013-02-24 Thread JJ Allaire
> Unfortunately, at the moment modules and attributes don't play together. > The attributes feature used to be built on top of modules, but this caused > issues on windows. > > One thing we could perhaps negociate with JJ is recognition of the export > attribute on module. Something like : > > // [

Re: [Rcpp-devel] Rcpp modules and parsing an object back and forth between R & C++

2013-02-20 Thread Hadley Wickham
>> Until that happens, is it possible to write my own as and wrap methods? >> > > Sure. > > For as, You can get a Simple* using this: > > Simple* obj = as_module_object(x) ; > > For the details, see as.h, this will call this: > > template object as_module_object(SEXP x){ > retu

Re: [Rcpp-devel] Rcpp modules and parsing an object back and forth between R & C++

2013-02-20 Thread Romain Francois
Le 19/02/13 18:19, Hadley Wickham a écrit : Unfortunately, at the moment modules and attributes don't play together. The attributes feature used to be built on top of modules, but this caused issues on windows. One thing we could perhaps negociate with JJ is recognition of the export attribute o

Re: [Rcpp-devel] Rcpp modules and parsing an object back and forth between R & C++

2013-02-19 Thread Hadley Wickham
> Dirk has an example in the Rcpp gallery -- > http://gallery.rcpp.org/articles/custom-as-and-wrap-example/. Not sure if > you've seen it already, but it might help. Yeah, I've seen it - the problem in my case is understand the structure of the generate ref class so I can automatically generate fr

Re: [Rcpp-devel] Rcpp modules and parsing an object back and forth between R & C++

2013-02-19 Thread Kevin Ushey
Hi Hadley, Dirk has an example in the Rcpp gallery -- http://gallery.rcpp.org/articles/custom-as-and-wrap-example/. Not sure if you've seen it already, but it might help. -Kevin On Tue, Feb 19, 2013 at 9:19 AM, Hadley Wickham wrote: > > Unfortunately, at the moment modules and attributes don't

Re: [Rcpp-devel] Rcpp modules and parsing an object back and forth between R & C++

2013-02-19 Thread Hadley Wickham
> Unfortunately, at the moment modules and attributes don't play together. The > attributes feature used to be built on top of modules, but this caused > issues on windows. > > One thing we could perhaps negociate with JJ is recognition of the export > attribute on module. Something like : > > // [

Re: [Rcpp-devel] Rcpp modules and parsing an object back and forth between R & C++

2013-02-19 Thread Romain Francois
Le 19/02/13 17:21, Hadley Wickham a écrit : Hi all, I'd like to have a simple C++ object that I can work with in either C++ or R. I can create the class, and expose it to R with modules (https://gist.github.com/hadley/4987110), but I don't know how to write the SEXP constructor or SEXP() operat

Re: [Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-07-08 Thread Romain Francois
Le 08/07/11 14:22, Jonas Rauch a écrit : Hi Romain, glad to hear that! Although I solved my original problem with the workaround described, I would be happy to do some testing when you have a solution. Noted :-) On Fri, Jul 8, 2011 at 2:00 PM, Romain Francois mailto:[email protected]>

Re: [Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-07-08 Thread Jonas Rauch
Hi Romain, glad to hear that! Although I solved my original problem with the workaround described, I would be happy to do some testing when you have a solution. On Fri, Jul 8, 2011 at 2:00 PM, Romain Francois wrote: > Le 07/07/11 15:18, Romain Francois a écrit : > > Le 15/06/11 14:57, Douglas B

Re: [Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-07-08 Thread Romain Francois
Le 07/07/11 15:18, Romain Francois a écrit : Le 15/06/11 14:57, Douglas Bates a écrit : On Wed, Jun 15, 2011 at 6:38 AM, Jonas Rauch wrote: Hey again, just to clarify: The final solution was to implement all methods of the derived class that are to be exposed to R and to call the method of the

Re: [Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-07-07 Thread Romain Francois
Le 15/06/11 14:57, Douglas Bates a écrit : On Wed, Jun 15, 2011 at 6:38 AM, Jonas Rauch wrote: Hey again, just to clarify: The final solution was to implement all methods of the derived class that are to be exposed to R and to call the method of the base class explicitly: class Bar : public F

Re: [Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-06-15 Thread Douglas Bates
On Wed, Jun 15, 2011 at 6:38 AM, Jonas Rauch wrote: > Hey again, > > just to clarify: The final solution was to implement all methods of the > derived class that are to be exposed to R and to call the method of the base > class explicitly: > > class Bar : public Foo { >     ... >     void doSometh

Re: [Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-06-15 Thread Jonas Rauch
Hey again, just to clarify: The final solution was to implement all methods of the derived class that are to be exposed to R and to call the method of the base class explicitly: class Bar : public Foo { ... void doSomething() { Foo::doSomething() } }; Of course that is not very elegant b

Re: [Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-06-14 Thread Jonas Rauch
Actually, having just the declaration like this compiled fine but and ended up in an unresolved symbol when loading the library. class Bar : public Foo { ... void doSomething(); void Action() { [some code here] } }; I actually had to implement doSomething and explicitly

Re: [Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-06-14 Thread Dirk Eddelbuettel
Hi Jonas, On 14 June 2011 at 19:06, Jonas Rauch wrote: | I am trying to write an R interface to a library that uses derived classes in | the following manner: | | class Foo { |     ... |     virtual void Action() = 0; |     void doSomething() { |     Action(); |     [do complicated stuff

Re: [Rcpp-devel] Rcpp Modules - Failed to initialize module pointer

2011-04-09 Thread schattenpflanze
Is there a way to load/initialize the module in such a way that > library(testmod) > yada immediately yields the full description above? Aha, it seems that setting the (yet undocumented) option 'mustStart' to 'TRUE' in the Module command inside .onLoad() does the trick :-). Best regards, Pete

Re: [Rcpp-devel] Rcpp Modules - Failed to initialize module pointer

2011-04-09 Thread schattenpflanze
OK, I think I got it. After restarting with a clean workspace, the message changed to > yada Uninitialized module named "yada" from package "testmod", which is probably due to some kind of lazy loading. I can then directly call > yada$foo(2,3) [1] 6 > yada Rcpp module 'yada' 6 functions:

Re: [Rcpp-devel] Rcpp modules : help with the design

2010-06-04 Thread Romain Francois
Le 31/05/10 20:07, Romain Francois a écrit : Thanks John, Le 31/05/10 18:23, John Chambers a écrit : Just a couple of comments. 1. class names One result of creating an S4 class with the same name as the C++ class is that you may be hiding another S4 class of that name. Always possible in any

Re: [Rcpp-devel] Rcpp modules : help with the design

2010-05-31 Thread Romain Francois
Thanks John, Le 31/05/10 18:23, John Chambers a écrit : Just a couple of comments. 1. class names One result of creating an S4 class with the same name as the C++ class is that you may be hiding another S4 class of that name. Always possible in any application, but when dealing with an inter-sy

Re: [Rcpp-devel] Rcpp modules : help with the design

2010-05-29 Thread Romain Francois
Le 29/05/10 09:10, Romain Francois a écrit : Hello, Currently, when exposing a c++ class to R through a Rcpp module, e.g: class World { public: World() : msg("hello"){} void set(std::string msg) { this->msg = msg; } std::string greet() { return msg; } private: std::string msg; }; void clearW

Re: [Rcpp-devel] Rcpp modules take 3, now with a vignette

2010-05-27 Thread Davor Cubranic
That's pretty cool. It's good to know it should be doable -- I'll give it a whack, once (if) I graduate to that level of expertise with template meta-programming and R internals. Davor On 2010-05-27, at 12:36 PM, Romain Francois wrote: > Davor, > > Rcpp modules currently does not handle enum

Re: [Rcpp-devel] Rcpp modules take 3, now with a vignette

2010-05-27 Thread Romain Francois
Davor, Rcpp modules currently does not handle enum types, but Boost.Python does, so I suppose we could have similar syntax. http://www.boost.org/doc/libs/1_43_0/libs/python/doc/v2/enum.html This is not high on my priority list, but if you want to prepare some patch, I'll look into it. Roma

Re: [Rcpp-devel] Rcpp modules take 3, now with a vignette

2010-05-27 Thread Davor Cubranic
Hi Romain, Can you tell me if this mechanism can somehow be used for passing enum-type arguments from R to Rcpp? I'm currently using strings or integers, and hope there can be an easier way to keep the two sides of the code from getting out of sync. Davor On 2010-05-27, at 2:35 AM, Romain Fr

Re: [Rcpp-devel] Rcpp modules take 2, exposing C++ classes to R

2010-05-26 Thread Romain Francois
Here is a self contained example, that uses both svn version of Rcpp and svn version of inline (for getDynLib) : require( Rcpp ) require( methods ) code <- '' inc <- ' class World { public: World() : msg("hello"){} void set(std::string msg) { this->msg = msg; } std::string greet

Re: [Rcpp-devel] Rcpp modules

2010-05-20 Thread Dirk Eddelbuettel
On 20 May 2010 at 09:49, Romain Francois wrote: | Le 20/05/10 09:33, Dirk Eddelbuettel a écrit : | > | > On 19 May 2010 at 15:07, Romain Francois wrote: | > | One thing perhaps I'd like opinions about is the use if the name | > | "function" in : | > | | > | RCPP_MODULE(yada){ | > | using namespa

Re: [Rcpp-devel] Rcpp modules

2010-05-20 Thread Romain Francois
Le 20/05/10 09:33, Dirk Eddelbuettel a écrit : On 19 May 2010 at 15:07, Romain Francois wrote: | One thing perhaps I'd like opinions about is the use if the name | "function" in : | | RCPP_MODULE(yada){ | using namespace Rcpp ; | function( "hello" ,&hello ) ; | } | | Boost.Python use

Re: [Rcpp-devel] Rcpp modules

2010-05-20 Thread Dirk Eddelbuettel
On 19 May 2010 at 15:07, Romain Francois wrote: | One thing perhaps I'd like opinions about is the use if the name | "function" in : | | RCPP_MODULE(yada){ | using namespace Rcpp ; | function( "hello" , &hello ) ; | } | | Boost.Python uses "def" but this is too pythonic for me. OTOH

Re: [Rcpp-devel] Rcpp modules

2010-05-19 Thread Romain Francois
One thing perhaps I'd like opinions about is the use if the name "function" in : RCPP_MODULE(yada){ using namespace Rcpp ; function( "hello" , &hello ) ; } Boost.Python uses "def" but this is too pythonic for me. OTOH, having both Rcpp::Function (the class that deals with R fun