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

McGehee, Robert Robert.McGehee at geodecapital.com
Mon Jun 6 23:30:30 CEST 2005

The bug might be here:
> is.null(expression())
[1] TRUE

> is.null(expression(NULL))

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.


-----Original Message-----
From: Duncan Murdoch [mailto:murdoch at stats.uwo.ca] 
Sent: Monday, June 06, 2005 4:58 PM
To: Peter Dalgaard
Cc: r-devel at stat.math.ethz.ch
Subject: Re: [Rd] Bug in new() or validObject() in methods package

On 6/6/2005 4:55 PM, Peter Dalgaard wrote:
> murdoch at stats.uwo.ca writes:
>> Is it doing an extra eval or something?  It looks like it:
>>  > x <- expression()
>>  > x
>> expression()
>>  > eval(x)
>>  >
>>  > x <- quote(expression())
>>  > x
>> expression()
>>  > eval(x)
>> expression()
>>  > eval(eval(x))
> You do realize that the two expression() results are not identical:
>> x <- quote(expression())
>> class(x)
> [1] "call"
>> x <- expression()
>> class(x)
> [1] "expression"
> Not that I can fathom what bearing that has on the real problem...

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.


R-devel at stat.math.ethz.ch mailing list

More information about the R-devel mailing list