From richierocks at gmail.com  Thu Sep 10 15:03:24 2015
From: richierocks at gmail.com (Richard Cotton)
Date: Thu, 10 Sep 2015 16:03:24 +0300
Subject: [Rd] Using IDs to suppress specific messages and warnings
In-Reply-To: <alpine.DEB.2.10.1509100642530.2561@luke-Latitude>
References: <CAPp_+=dnGknY1_SzsMw48q89LCBvavrceUZj4hyowWt8YAOseg@mail.gmail.com>
	<alpine.DEB.2.10.1509100642530.2561@luke-Latitude>
Message-ID: <CAPp_+=f5bsevd=Cpw5jTm2+H6qjES_qykMkVtBo4FPvC3+RHRA@mail.gmail.com>

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



[Rd] Using IDs to suppress specific messages and warnings
Richard Cotton