[Rd] C/C++ 'assert' should not be used in R packages

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Sat, 10 Nov 2007 08:50:10 +0000 (GMT)


Please don't use 'assert' in R packages. If called, this means that an error in your code aborts the whole R process, including your user's work. I see several R packages doing this, and one of them called 'assert' on me earlier in the week.

We provide 'error': please do use it to return control to the user when your code misbehaves.

Similarly 'exit' and 'abort' should never be used in R packages.

Sometimes it is not under your control: I sometimes see an rgl failure at

R: indirect_vertex_array.c:659: emit_DrawArrays_old: Assertion `elements_per_request >= count' failed.

that is coming from the Mesa GL libraries.

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Sat 10 Nov 2007 - 08:54:24 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 10 Nov 2007 - 13:30:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.