From h.wickham at gmail.com  Tue Oct 30 23:25:55 2012
From: h.wickham at gmail.com (Hadley Wickham)
Date: Tue, 30 Oct 2012 17:25:55 -0500
Subject: [Rd] Class generator functions for reference classes
In-Reply-To: <508C4D16.4070104@r-project.org>
References: <508C4D16.4070104@r-project.org>
Message-ID: <CABdHhvGCd2QwBV=94hSn92-L3aoBchyEGAyyVrgTwrcysve0BQ@mail.gmail.com>

> As of rev. 61035 in r-devel, setRefClass() now returns a generator function,
> as setClass() has done since 2.15.0.
>
> The convenient style is now:
>   mEdit <- setRefClass("mEdit",......)
>   xx <- mEdit(data = xMat)
>
> instead of
>   xx <- mEdit$new(data = xMat)
>
> The returned object still has fields and methods accessible as before.

Similarly, would it be possible for setGeneric and setMethod to return
the equivalent generic and method objects?

Hadley

-- 
RStudio / Rice University
http://had.co.nz/



[Rd] Class generator functions for reference classes
Hadley Wickham