Re: [Rd] possibly invalid assertion in setRefClass?

From: John Chambers <jmc_at_r-project.org>
Date: Thu, 02 Jun 2011 09:29:06 -0700

Right, but Michael's point is valid. It's the standard bug from having to explicitly check for a non-empty list before taking names(x).

Will fix. Thanks for the catch.

John

On 6/1/11 9:21 AM, William Dunlap wrote:
>> -----Original Message-----
>> From: r-devel-bounces_at_r-project.org
>> [mailto:r-devel-bounces_at_r-project.org] On Behalf Of Michael Lawrence
>> Sent: Wednesday, June 01, 2011 9:15 AM
>> To: r-devel_at_r-project.org
>> Subject: [Rd] possibly invalid assertion in setRefClass?
>>
>>> setRefClass("Foo", fields = list())
>> Error in setRefClass("Foo", fields = list()) :
>> A list argument for fields must have nonempty names for all
>> the fields
>>
>> In my opinion, the above should not fail. There are no fields.
>
> You can work around it by attaching an empty names attribute
> to fields:
> > setRefClass("Foo", fields = structure(list(), names=character()))
> Generator object for class "Foo":
>
> No fields defined
>
> Class Methods:
> "callSuper", "copy", "export", "field", "getClass", "getRefClass",
> "import", "initFields"
>
>
> Reference Superclasses:
> "envRefClass"
>
> Bill Dunlap
> Spotfire, TIBCO Software
> wdunlap tibco.com
>
>
>>
>> Thanks,
>> Michael
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-devel_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 02 Jun 2011 - 16:31:04 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 02 Jun 2011 - 16:40:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive