On Tue, Nov 20, 2012 at 9:54 AM, Hadley Wickham <span dir="ltr"><<a href="mailto:h.wickham@gmail.com" target="_blank">h.wickham@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">> P.S. I don't think the sugar versions can be made any quicker, because<br>
> they have to allocate intermediate vectors, and do more memory copies.<br>
<br>
</div>I don't think they _have_to - my understanding is that the expression<br>
template approach is general enough that you could compile away those<br>
intermediates.  It may be extremely difficult to do though!<br></blockquote><div><br></div><div>That's the issue in delayed evaluation.  You do a lot of template magic to discover how the result is going to be used before you evaluate it.  It has its place but for cases like this it seems like what Ed Deming would have called "burning the toast and then scraping it".</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im HOEnZb"><br>
Hadley<br>
<br>
--<br>
RStudio / Rice University<br>
<a href="http://had.co.nz/" target="_blank">http://had.co.nz/</a><br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</div></div></blockquote></div><br></div>