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.
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. On Sat, Feb 8, 2020 at 3:23 PM Joshua N Pritikin <jpriti...@pobox.com> wrote: > On Sat, Feb 08, 2020 at 02:55:06PM -0500, JJ Allaire wrote: > > Yes, the only reason to use Rcpp::stop is because you want a C++ > > exception translated safely into an Rf_error at the SEXP call level. > If > > you are trying to signal an error from a background thread you would > > want to use a regular C++ exception rather than Rcpp::stop. > > I'm disappointed that there is no interest in making Rcpp::stop work > in both contexts. > > At a minimum, the distinct uses of C++ exceptions and Rcpp::stop > should be documented better. > > -- > Joshua N. Pritikin, Ph.D. > Virginia Institute for Psychiatric and Behavioral Genetics > Virginia Commonwealth University > PO Box 980126 > 800 E Leigh St, Biotech One, Suite 1-133 > Richmond, VA 23219 > http://exuberant-island.surge.sh >
_______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel