From tplate at blackmesacapital.com  Fri Sep  8 22:21:20 2006
From: tplate at blackmesacapital.com (Tony Plate)
Date: Fri, 08 Sep 2006 14:21:20 -0600
Subject: [Rd] (PR#9202) Re: Bugs with partial name matching
In-Reply-To: <69C0202D-ED5A-495A-9F38-FD2F7F132C29@uic.edu>
References: <20060905014002.634C928F8E@slim.kubism.ku.dk>	<Pine.LNX.4.64.0609051507530.17674@homer23.u.washington.edu>	<Pine.LNX.4.64.0609051542310.17674@homer23.u.washington.edu>
	<69C0202D-ED5A-495A-9F38-FD2F7F132C29@uic.edu>
Message-ID: <4501D0C0.7080705@blackmesacapital.com>

Anil Maliyekkel wrote:
> [snip]
> 
> Going back to the original partial replacement problem, is there  
> anyway to turn off partial matching, or to selectively apply exact  
> matching when trying to access a single element?  I can get the  
> desired single element match using the convoluted syntax D["ABC"] 
> [[1]] and perform partial replacement operations on a new column.   
> However, it would be nice to have single element access operator that  
> does exact matching.

The easiest thing to do is probably to always supply full names, and if 
you want to create a new component, then create it in its entirity (not 
by assigning to a subset of a non-existent component).

A couple of years ago I proposed (with code) an operator '$$' that did 
only exact matching, but that proposal didn't gather any interest at the 
time.  It might actually make more sense to have the roles switched, so 
that the ordinary '$' required exact matches, while the special '$$' 
allowed partial matching (to allow for convenient interactive use). 
But, that's probably a bigger change than the R code base & community 
could bear.

Then again, what about the following as a way forward to eliminating 
partial matching on names for "$" and "[[":

(1) Announce that partial matching for "$" and "[[" is deprecated

(1a) (optional) Introduce "$$" operator with partial matching, intended 
solely for interactive use, with QA checks to ensure that it is not used 
in packages

(2) Introduce warnings upon use of partial matching with "$" and "[[", 
with an option() to turn them off.  Initially these warnings are off by 
default, but QA tools turn them on, and package maintainers see the 
warnings.

(3) After a year or two (assuming most packages no longer contain use of 
partial matching), change the default warning about partial matching to 
"on".

(4) After another year, eliminate partial matching with "$" and "[[".

Opinions?

-- Tony Plate

> 
> Anil
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>




[Rd] (PR#9202) Re: Bugs with partial name matching
Tony Plate