From janko.thyson.rstuff at googlemail.com  Wed Dec  7 16:36:56 2011
From: janko.thyson.rstuff at googlemail.com (Janko Thyson)
Date: Wed, 07 Dec 2011 16:36:56 +0100
Subject: [Rd] Possible bug in 'new()' for Reference Classes
Message-ID: <4EDF8818.9000201@googlemail.com>

Dear list,

I think I stumbled across a little bug with respect to the standard 
initialization routine for Reference Classes.

It seems that a field 'self' is treated as if it's name would be '.self' 
(which we know is reserved for the self reference of the instantiated 
object itself) and thus an error is thrown.
If the field value is assigned in an explicit call after the 
instantiation via 'new()', everything works just fine:

setRefClass("ClassInfo",
         fields=list(
             self="character", super="character", sub="character"
         )
     )
     new("ClassInfo", self="B", super="A", sub="C")    # Error

     x <- new("ClassInfo", super="A", sub="C")
     x
     x$self <- "B" # Works
     x

Best regards,
Janko



[Rd] Possible bug in 'new()' for Reference Classes
Janko Thyson