<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">(Sorry that I forgot to cc to the list... Here is my message... I just came back from dinner...)<div><div><br><div>Begin forwarded message:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>From: </b></span><span style="font-family:'Helvetica'; font-size:medium;">Tama Ma <<a href="mailto:pingnang@phys.ethz.ch">pingnang@phys.ethz.ch</a>><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>Date: </b></span><span style="font-family:'Helvetica'; font-size:medium;">November 4, 2011 5:59:53 PM GMT+01:00<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>To: </b></span><span style="font-family:'Helvetica'; font-size:medium;">Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>Subject: </b></span><span style="font-family:'Helvetica'; font-size:medium;"><b>Re: [Rcpp-devel] Wrapping copy constructor in rcpp?</b><br></span></div><br><div>Dear Dirk,<br><br><span class="Apple-tab-span" style="white-space:pre">        </span>Yes, if b = a.clone(); copies a into b. <br> In the C++ language, the following is what I mean: <br><br>typedef <my/favourite/class> object_type;<br><br>object_type a;<br>object_type b(a);<br><br><span class="Apple-tab-span" style="white-space:pre">        </span>Ultimately, what I desire in the R interface will be something like that:<br><br>a <- new(my/favorite/Rcpp/Module , ... );<br>b <- new(my/favorite/Rcpp/Module , a);<br><br><span class="Apple-tab-span" style="white-space:pre">        </span>But, if there exists such a clone() function that does the copying of Rcpp objects in the R interface, I am just as satisfied.<br><br>Best regards,<br>Tama Ma<br><br><br><br><br><br>On Nov 4, 2011, at 5:51 PM, Dirk Eddelbuettel wrote:<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">On 4 November 2011 at 17:08, Tama Ma wrote:<br></blockquote><blockquote type="cite">| Dear Dirk,<br></blockquote><blockquote type="cite">| <br></blockquote><blockquote type="cite">| <span class="Apple-tab-span" style="white-space:pre">        </span>Thanks for the reply. I am pretty sure that it has not been implemented yet, and I will try to look into it. From a practical point of view, I would want to copy a "Rcpp" object in the R interface, and not a "copy-by-pointer" approach now. <br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">You mean just like what clone() does?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Dirk<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">| <span class="Apple-tab-span" style="white-space:pre">        </span>Thank you once again.<br></blockquote><blockquote type="cite">| <br></blockquote><blockquote type="cite">| Best regards,<br></blockquote><blockquote type="cite">| Tama Ma<br></blockquote><blockquote type="cite">| <br></blockquote><blockquote type="cite">| <br></blockquote><blockquote type="cite">| On Nov 4, 2011, at 4:48 PM, Dirk Eddelbuettel wrote:<br></blockquote><blockquote type="cite">| <br></blockquote><blockquote type="cite">| > <br></blockquote><blockquote type="cite">| > On 4 November 2011 at 16:08, Tama Ma wrote:<br></blockquote><blockquote type="cite">| > | Dear Rcpp developers,<br></blockquote><blockquote type="cite">| > | <br></blockquote><blockquote type="cite">| > | <span class="Apple-tab-span" style="white-space:pre">        </span>Maybe my previous email has been ignored. I am asking whether there is a possibility to wrap the copy constructor in a C++ class via Rcpp? <br></blockquote><blockquote type="cite">| > <br></blockquote><blockquote type="cite">| > You get a firm "maybe" and even an additional "why not" from me.<br></blockquote><blockquote type="cite">| > <br></blockquote><blockquote type="cite">| > I am a little unsure exactly what you are after. Basic Rcpp functions _all_<br></blockquote><blockquote type="cite">| > have to conform to the .Call()-required interface<br></blockquote><blockquote type="cite">| > <br></blockquote><blockquote type="cite">| > extern "C" SEXP foo(SEXP a, SEXP b)<br></blockquote><blockquote type="cite">| > <br></blockquote><blockquote type="cite">| > signature (for a variable number of arguments). <br></blockquote><blockquote type="cite">| > <br></blockquote><blockquote type="cite">| > So no ctor or copy ctor here. <br></blockquote><blockquote type="cite">| > <br></blockquote><blockquote type="cite">| > So I presume you are talking about Rcpp Modules? We have some documentation<br></blockquote><blockquote type="cite">| > on what is possible. If you don't see an explicit mention or example or unit<br></blockquote><blockquote type="cite">| > test doing it, then maybe it hasn't been implemented yet. But this is Open<br></blockquote><blockquote type="cite">| > Source and you have already contributed a patch so you know the drill, right :)<br></blockquote><blockquote type="cite">| > <br></blockquote><blockquote type="cite">| > Dirk<br></blockquote><blockquote type="cite">| > <br></blockquote><blockquote type="cite">| > -- <br></blockquote><blockquote type="cite">| > "Outside of a dog, a book is a man's best friend. Inside of a dog, it is too<br></blockquote><blockquote type="cite">| > dark to read." -- Groucho Marx<br></blockquote><blockquote type="cite">| > <br></blockquote><blockquote type="cite">| <br></blockquote><blockquote type="cite">| <br></blockquote><blockquote type="cite">| Best regards,<br></blockquote><blockquote type="cite">| Tama Ma <br></blockquote><blockquote type="cite">| (+41 78 640 50 15)<br></blockquote><blockquote type="cite">| <br></blockquote><blockquote type="cite">| <a href="mailto:pingnang@phys.ethz.ch">pingnang@phys.ethz.ch</a><br></blockquote><blockquote type="cite">| <a href="http://www.phys.ethz.ch/~pingnang">www.phys.ethz.ch/~pingnang</a><br></blockquote><blockquote type="cite">| <br></blockquote><blockquote type="cite">| HIT K 31.3<br></blockquote><blockquote type="cite">| Institut für Theoretische Physik<br></blockquote><blockquote type="cite">| Wolfgang-Pauli-Strasse 27<br></blockquote><blockquote type="cite">| ETH Hönggerberg<br></blockquote><blockquote type="cite">| 8093 Zürich<br></blockquote><blockquote type="cite">| Switzerland<br></blockquote><blockquote type="cite">| <br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">-- <br></blockquote><blockquote type="cite">"Outside of a dog, a book is a man's best friend. Inside of a dog, it is too<br></blockquote><blockquote type="cite">dark to read." -- Groucho Marx<br></blockquote><blockquote type="cite"><br></blockquote><br><br>Best regards,<br>Tama Ma <br>(+41 78 640 50 15)<br><br><a href="mailto:pingnang@phys.ethz.ch">pingnang@phys.ethz.ch</a><br>www.phys.ethz.ch/~pingnang<br><br>HIT K 31.3<br>Institut für Theoretische Physik<br>Wolfgang-Pauli-Strasse 27<br>ETH Hönggerberg<br>8093 Zürich<br>Switzerland<br><br></div></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><span class="Apple-tab-span" style="white-space: pre; "><br class="Apple-interchange-newline"><span class="Apple-style-span" style="white-space: normal; ">Best regards,</span></span></div><div>Tama Ma </div><div>(+41 78 640 50 15)</div><div><br></div><div><a href="mailto:pingnang@phys.ethz.ch">pingnang@phys.ethz.ch</a></div><div><a href="http://www.phys.ethz.ch/~pingnang">www.phys.ethz.ch/~pingnang</a></div><div><br></div><div>HIT K 31.3</div><div>Institut für Theoretische Physik</div><div>Wolfgang-Pauli-Strasse 27</div><div>ETH Hönggerberg</div><div>8093 Zürich</div><div>Switzerland</div></span></span>
</div>
<br></div></body></html>