<div dir="ltr">I think the point is that the *only* reason Rcpp::stop exists is to do forwarding to Rf_error. If that isn't your intention it's strictly worse than a normal C++ exception. <div><br></div><div>Agreed that it would be good to have more clear docs here. Note that as Dirk pointed out both Writing R Extensions and RcppParallel docs are pretty clear about the fact that you shouldn't call any R APIs when in a background thread.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 8, 2020 at 3:23 PM Joshua N Pritikin <<a href="mailto:jpritikin@pobox.com">jpritikin@pobox.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, Feb 08, 2020 at 02:55:06PM -0500, JJ Allaire wrote:<br>
>    Yes, the only reason to use Rcpp::stop is because you want a C++<br>
>    exception translated safely into an Rf_error at the SEXP call level. If<br>
>    you are trying to signal an error from a background thread you would<br>
>    want to use a regular C++ exception rather than Rcpp::stop.<br>
<br>
I'm disappointed that there is no interest in making Rcpp::stop work <br>
in both contexts.<br>
<br>
At a minimum, the distinct uses of C++ exceptions and Rcpp::stop <br>
should be documented better.<br>
<br>
-- <br>
Joshua N. Pritikin, Ph.D.<br>
Virginia Institute for Psychiatric and Behavioral Genetics<br>
Virginia Commonwealth University<br>
PO Box 980126<br>
800 E Leigh St, Biotech One, Suite 1-133<br>
Richmond, VA 23219<br>
<a href="http://exuberant-island.surge.sh" rel="noreferrer" target="_blank">http://exuberant-island.surge.sh</a><br>
</blockquote></div>