From jmc at r-project.org  Thu Jun  2 18:29:06 2011
From: jmc at r-project.org (John Chambers)
Date: Thu, 02 Jun 2011 09:29:06 -0700
Subject: [Rd] possibly invalid assertion in setRefClass?
In-Reply-To: <77EB52C6DD32BA4D87471DCD70C8D7000442FAFD@NA-PA-VBE03.na.tibco.com>
References: <BANLkTi=zosXhcfDav-Ov69MKdKAXgf8dtw@mail.gmail.com>
	<77EB52C6DD32BA4D87471DCD70C8D7000442FAFD@NA-PA-VBE03.na.tibco.com>
Message-ID: <4DE7BA52.4090904@r-project.org>

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
>



[Rd] possibly invalid assertion in setRefClass?
John Chambers