From sfalcon at fhcrc.org  Wed Jan 31 18:39:57 2007
From: sfalcon at fhcrc.org (Seth Falcon)
Date: Wed, 31 Jan 2007 09:39:57 -0800
Subject: [Rd] S4 initialize or "generating function"
In-Reply-To: <45C0CF7B.90606@tu-dresden.de> (Thomas Petzoldt's message of "Wed,
	31 Jan 2007 18:18:51 +0100")
References: <45BFB590.3080405@TU-Dresden.de> <m2r6tbdyqc.fsf@fhcrc.org>
	<45C0BF94.9020100@tu-dresden.de> <m2wt33cg46.fsf@fhcrc.org>
	<45C0CF7B.90606@tu-dresden.de>
Message-ID: <m23b5rccya.fsf@fhcrc.org>

Thomas Petzoldt <Thomas.Petzoldt at tu-dresden.de> writes:
> Your example works but one can not arbitrarily mix slots, other named
> arguments and the default callNextMethod(). The documentation states:
>
> "... 	Data to include in the new object. Named arguments correspond
> to slots in the class definition."

And this is where I start to get bent out of shape with what
"initialize" wants to assume about how _my_ objects should get
created...

> In such cases one has to add the arguments to callNextMethod(y=1)
> explicitly.

Yes.  There are other cases where you will only get the correct
behavior if you explicitly list args to callNextMethod (I believe that
one case is where your generic has default args).  I guess in my view,
constructors are just another method and so one shouldn't expect them
to align so tightly for related classes.

+ seth



[Rd] S4 initialize or "generating function"
Seth Falcon