From r.hankin at noc.soton.ac.uk  Fri Sep  1 15:58:29 2006
From: r.hankin at noc.soton.ac.uk (Robin Hankin)
Date: Fri, 1 Sep 2006 14:58:29 +0100
Subject: [Rd] setMethod("Logic", ...)
Message-ID: <91AD8AFC-E5A3-4F79-821D-CACC2705333D@soc.soton.ac.uk>

Hi


In V&R the "polynomial" class is explicitly specified to have no  
logical operators:

setMethod("Logic", signature(e1="polynomial"), function(e1,e2){stop 
("...")})


  I too have a class of objects for which I want to
specify that Logic operators do not work, but executing



setClass("brob",
          representation = representation 
(x="numeric",positive="logical"),
          prototype      = list(x=numeric(),positive=logical())
          )

setMethod("Logic",signature(e1="brob"), function(e1,e2)
           {
             stop("No logic currently implemented for brob objects")
           }
)


gives me


Error in setMethod("Logic", signature(e1 = "brob"), function(e1, e2) { :
	no existing definition for function 'Logic'


?Math seems to imply that there is no "Logic" group.

So, what is the correct way to specify that logical operations are
not allowed  for "brob" objects?





--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743




[Rd] setMethod("Logic", ...)
Robin Hankin