Skip to content

Bug in new() or validObject() in methods package (PR#7922)

2 messages · McGehee, Robert, Duncan Murdoch

#
The bug might be here:
[1] TRUE

But
[1] FALSE

So it might look to the methods package like you're passing in a NULL
value for @bar. I might argue that expression() should not be NULL (and
only NULL is NULL) as I have had similar trouble trying to extend
language objects to S4 classes, partially because length 0 name, call
and expression objects are either not available, or in this case,
handled poorly.

Robert

-----Original Message-----
From: Duncan Murdoch [mailto:murdoch@stats.uwo.ca] 
Sent: Monday, June 06, 2005 4:58 PM
To: Peter Dalgaard
Cc: r-devel@stat.math.ethz.ch
Subject: Re: [Rd] Bug in new() or validObject() in methods package
(PR#7922)
On 6/6/2005 4:55 PM, Peter Dalgaard wrote:
I figured they weren't identical, given that they gave different results

  when eval'd, but I didn't know what the difference was exactly.
Thanks!

Duncan

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
#
McGehee, Robert wrote:
I think you've spotted it.  The internal code for is.null checks for 
NULL or a zero length expression, not just for NULL.  Changing that so 
it only accepts NULL fixes this bug.

This code has been in place since prehistoric times, so I'm going to 
tread pretty carefully here before I commit a change.

Duncan Murdoch