From hb at maths.lth.se  Tue Nov 16 12:54:51 2004
From: hb at maths.lth.se (Henrik Bengtsson)
Date: Tue Nov 16 12:55:08 2004
Subject: [Rd] UseMethod call with no arguments - solved, I think
In-Reply-To: <005001c4cb44$697b7610$e502eb82@hblaptop>
Message-ID: <002301c4cbd3$15268340$e502eb82@hblaptop>

Hmmm, to follow up on my own question; it is likely that I have
misunderstood the update note. Now, I read it as

foo <- function(x, ...) UseMethod()

is deprecated and that

foo <- function(x, ...) UseMethod("foo", x)

( or foo <- function(x, ...) UseMethod("foo") )

should be used.

My concern/interpretation was that

bar <- function(...) UseMethod("bar")

is deprecated (where I saw "..." as the "arguments"). Reading ?UseMethod
more carefully (it still says) - "If it is called with just one argument,
the class of the first argument of the enclosing function is used as
'object': unlike S this is the actual argument passed and not the current
value of the object of that name." - I see that the above should still be
fine.

So, now the note makes perfectly sense and it is *not* a "big step".

Best wishes

Henrik


> -----Original Message-----
> From: r-devel-bounces@stat.math.ethz.ch 
> [mailto:r-devel-bounces@stat.math.ethz.ch] On Behalf Of 
> Henrik Bengtsson
> Sent: Monday, November 15, 2004 7:54 PM
> To: R-devel@r-project.org
> Subject: [Rd] UseMethod call with no arguments
> 
> 
> Dear R developers,
> 
> I will ask a very straightforward question concerning 
> UseMethod's future, because people depending on my code 
> wonder what will happen to it next.
> 
> In R v2.0.1 NEWS it says
> 
>     o	The undocumented use of UseMethod() with no argument is now
> 	formally deprecated. 
> 
> and in the R v2.0.1 help(UseMethod) it says
> 
>   'UseMethod' accepts a call with no arguments and tries to deduce
>    the generic from the context.  This was undocumented on the help
>    page and is now deprecated.  It is allowed but 'strongly
>    discouraged' in S-PLUS.
> 
> The short question is: UseMethod() with no arguments is 
> deprecated. Typically, after making something deprecated it 
> will later become defunct. Do you have any plans for when 
> this will happen? Are we talking months, years or in reality 
> never? A version number?
> 
> Second, in R v2.0.0 NEWS there was nothing on making 
> UseMethod() without arguments deprecated (the latest patched 
> version I have is dated October 21st). As I believe a rather 
> big step has been taken, I am somewhat surprised that I 
> haven't seen it discussed. Was there a discussion taking 
> place elsewhere that I missed, or is it an "obvious" update?
> 
> Finally, many thanks for making R (the software, the help, 
> the community,
> ...) to what it is.
> 
> Best wishes
> 
> Henrik Bengtsson
> 
> Dept. of Mathematical Statistics @ Centre for Mathematical Sciences 
> Lund Institute of Technology/Lund University, Sweden (+2h UTC)
> +46 46 2229611 (off), +46 708 909208 (cell), +46 46 2224623 (fax)
> h b @ m a t h s . l t h . s e, http://www.maths.lth.se/~hb/
> 
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
>


[Rd] UseMethod call with no arguments - solved, I think
Henrik Bengtsson