[Rcpp-devel] Simplest Class Example For Starters

Dirk Eddelbuettel edd at debian.org
Fri May 31 03:52:13 CEST 2013

On 30 May 2013 at 18:08, ivo welch wrote:
| hi dirk---it is indeed excellent.  alas, it doesn't cover my confusion.

I reckon you did not read 'Rcpp attributes' carefully enough. Please do read
it again.

| determines whether one needs to declare attributes vs. Rcpp being smart enough

One has to declare what one wants. This is programming, not Disneyland where
the fairies do all the work.  

In essence, you still misunderstand cppFunction() vs sourceCpp(). You want
the latter.  Read 'Rcpp attributes' carefully.

| And somehow I need to figure out how to tell R to call a destructor when the x
| object goes out of scope.

You are somewhat lost at see.  Read 'Rcpp-introduction' aka our JSS paper
from 2011.  Read it several times.  

R manages objects for you.  That's why we call it "seamless".

| I don't want to take your time any longer, so I think it is better for me to
| give up here.

Yes we should stop now. You may not be quite as ready for this as you think
you are, and by more-or-less randomly trying things you are wasting your own
precious time.


Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com

More information about the Rcpp-devel mailing list