Re: [Rd] generics for primitive functions

2006-09-24 Thread Pr. Jean-Michel Collard
Short reply -- I'm away from regular web access for 2 days. The exception would break a simple test (is.object() essentially) and likely have serious efficiency problems. You'd need a better argument, I suspect. > Yes, I figured I might have entered the forbidden zone (one hint was > that I had

Re: [Rd] generics for primitive functions

2006-09-23 Thread Parlamis Franklin
Yes, I figured I might have entered the forbidden zone (one hint was that I had to set the group method to achieve my goal -- an attempt to directly set a method for the 'sqrt' function was frustrated in the manner you suggest). I have two followup questions and a request: (i) Should I expe

Re: [Rd] generics for primitive functions

2006-09-23 Thread John Chambers
Probably a bug, but not at all the one you imply. You have found a way to subvert a guarantee in R that methods for primitives can never be redefined for basic data types. As you no doubt found, but didn't show us, so long as you say sqrt(4) the result is correct. (Your "Works" should really

[Rd] generics for primitive functions

2006-09-22 Thread Parlamis Franklin
i think these two code snippets exhibit a bug. they are identical but for the inclusion of an initial line in snippet [2] [1] setMethod("Math", signature(x = "numeric"), function(x) "Works") getGeneric("sqrt")(4) [2] getGeneric("sqrt")(4) setMethod("Math", signature(x = "numeric"), function(x)