[Rcpp-devel] Raise a condition

Tim Keitt tkeitt at utexas.edu
Thu Jun 19 02:40:01 CEST 2014


On Wed, Jun 18, 2014 at 6:26 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> Tim,
>
> Step back for a second and recognise that everything happens via
>
>    SEXP .Call(SEXP a, SEXP b, ...)
>
> where R calls your C++ routine asynchronously.
>
> You can do tricks _within the subroutine that is called_ which is
> essentially
> what happens via the automatically-added try/catch block we have in C++.
>  And
> Rcpp::stop() is just a shortcut for using those.
>

Can I throw a condition (meaning an object inheriting class "condition") or
am I limited to strings? If I throw a condition, will it be raised as such?

THK


>
> Beyond .Call() you just have what "Writing R Extension" describes in
> Section
> 6.2 "Error handling", the forementioned error() and warning() [ which we
> prefix with Rf_ as not-namespace-protected error() clashes too easily with
> macros or functions in other libraries ]
>
> Any other really low-hanging fruits would probably have been picked by
> other
> Rcpp users.
>
> Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>



-- 
http://www.keittlab.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20140618/468f9f96/attachment.html>


More information about the Rcpp-devel mailing list