[Rd] Return value of S4 validity function

2013-02-28 Thread Gabor Grothendieck
This issues a message about a needing to be non-negative as expected: setClass("A", representation = list(a = "numeric"), prototype = list(a = 0), validity = function(object) { out <- if (object@a < 0) "a must be non-negative" if (is.null(out)) TRUE else out ## }) new("A", a = -1)

Re: [Rd] Return value of S4 validity function

2013-02-28 Thread Gabor Grothendieck
On Thu, Feb 28, 2013 at 3:44 PM, Gabor Grothendieck wrote: > This issues a message about a needing to be non-negative as expected: > > setClass("A", > representation = list(a = "numeric"), > prototype = list(a = 0), > validity = function(object) { > out <- if (object@a < 0) "a must be no