[Rd] Using IDs to suppress specific messages and warnings

Richard Cotton richierocks at gmail.com
Thu Sep 10 15:03:24 CEST 2015


Thanks Luke,

On 10 September 2015 at 14:47,  <luke-tierney at uiowa.edu> wrote:
> Conditions have classes and the condition system is designed around
> the idea that classes would be used for this sort of thing. That is
> already how tryCatch and withCallingHandlers discriminate the
> conditions to handle.

That makes sense.  Though with my sqrt example, it's just a plain
simpleWarning, which doesn't give you the opportunity to do special
handling.

tryCatch(sqrt(-1), warning = function(w) class(w))
## [1] "simpleWarning" "warning"       "condition"


> Designing and implementing a condition class hierarchy to support this
> is indeed the hard/tedious part.

There are precedents from other languages that could be used as a
template.  For example, .NET and Java both have very well defined
exception hierarchies that could serve as a starting point.

https://msdn.microsoft.com/en-us/library/z4c5tckx%28v=vs.110%29.aspx
https://docs.oracle.com/javase/7/docs/api/java/lang/package-tree.html

Who is the best person to ask/cajole to start getting this implemented?

-- 
Regards,
Richie

Learning R
4dpiecharts.com



More information about the R-devel mailing list