From: Duncan Murdoch <murdoch_at_stats.uwo.ca>

Date: Tue 02 Jan 2007 - 00:32:29 GMT

*>
*

*>
*

> Really? The consistency issue only concerns mapply, I think.

R-devel@r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue Jan 02 11:34:20 2007

Date: Tue 02 Jan 2007 - 00:32:29 GMT

On 1/1/2007 12:59 PM, Charles C. Berry wrote:

> On Mon, 1 Jan 2007, Duncan Murdoch wrote:

*>
*

>> A few comments thrown in, and some general comments at the bottom. >> >> On 1/1/2007 1:28 AM, Gabor Grothendieck wrote: >>> This is my 2007 New Year wishlist for R features: >>> >>> 1. [deleted thru 12]

>>> 13. Make upper/lower case of simplify/SIMPLIFY consistent on all >>> apply commands and add a simplify= arg to by. >> It would have been good not to introduce the inconsistency years ago, >> but it's too late to change now. >>

> Really? The consistency issue only concerns mapply, I think.

mapply and its wrapper Vectorize, and perhaps some functions in contributed packages.

*>
*

> How 'bout changing the formals of mapply to

*>
**> $FUN
**>
**>
**> $...
**>
**>
**> $MoreArgs
**> NULL
**>
**> $SIMPLIFY
**> simplify
**>
**> $USE.NAMES
**> [1] TRUE
**>
**> $simplify
**> [1] TRUE
**>
**> i.e. add simplify = TRUE and change SIMPLIFY's default to 'simplify'
**>
**> Then the default behavior is retained, specifying a value for
**> either SIMPLIFY or simplify gives the desired behavior and SIMPLIFY takes
**> precedence over simplify if both are given values. Not pretty, perhaps,
**> but it does the job.
*

This allows mapply(..., simplify=TRUE), but is that really "the job"? I think the point of consistency is to make code easier to read and write, and I'm not sure making this one parameter partially case-insensitive achieves that. Should the same thing be done to the functions that currently use "simplify", to achieve even more consistency? Yecch.

> I suppose this could get one into trouble if one of the ... args is named

*> 'simplify', but I do not imagine that is a big deal.
*

I think the reasoning behind the choice of SIMPLIFY was probably to avoid a clash with one of the ... args.

I'd prefer a more general solution to this problem, like what the Mac GUI does, and giving argument hints as a function call is being typed. (I think ESS may do this too, but I don't use it.) There are lots of inconsistencies in R functions, and I think making the syntax looser in order to accept a consistent superset is not the right approach: instead, the editor should make it easier for a user to discover what is appropriate in any given context.

Duncan Murdoch

R-devel@r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue Jan 02 11:34:20 2007

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.1.8, at Tue 02 Jan 2007 - 19:32:24 GMT.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel.
Please read the posting
guide before posting to the list.
*