[Rcpp-devel] Dispatching based on SEXPTYPE

JJ Allaire jj.allaire at gmail.com
Mon Nov 26 21:58:00 CET 2012

On Mon, Nov 26, 2012 at 3:52 PM, Davor Cubranic <cubranic at stat.ubc.ca>wrote:

> Is this macro intended to be used in other, similar contexts? Otherwise,
> why not have "switch" inside unique2, as in Hadley's original code?

Yes the idea was that if you had dozens of functions that had an identical
switch/case dispatch then you would have cleaner syntax + less bugs by
using a macro.

If this was a one-off then obviously the switch/case inline would have
indeed been more clear.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20121126/21f8a6f4/attachment.html>

More information about the Rcpp-devel mailing list