From wdunlap at tibco.com  Tue Feb 10 18:12:59 2009
From: wdunlap at tibco.com (William Dunlap)
Date: Tue, 10 Feb 2009 09:12:59 -0800
Subject: [Rd] Bug in subsetting data frame (PR#13515)
In-Reply-To: <4991993E.3010204@stats.uwo.ca>
References: <20090210102506.CB966282EF48@mail.pubhealth.ku.dk>	<8b356f880902100459n321c321ew1ee4ab3c9a7ddb0f@mail.gmail.com>	<499181C3.6000907@stats.uwo.ca><8b356f880902100651n79fa3b04x5754f79e8ac17658@mail.gmail.com>
	<4991993E.3010204@stats.uwo.ca>
Message-ID: <77EB52C6DD32BA4D87471DCD70C8D700A881F4@NA-PA-VBE03.na.tibco.com>

> -----Original Message-----
> From: r-devel-bounces at r-project.org 
> [mailto:r-devel-bounces at r-project.org] On Behalf Of Duncan Murdoch
> Sent: Tuesday, February 10, 2009 7:12 AM
> To: Stavros Macrakis
> Cc: xinlee883 at stat.math.ethz.ch; r-devel at stat.math.ethz.ch
> Subject: Re: [Rd] Bug in subsetting data frame (PR#13515)

[ lots deleted ]

> > Indeed!  It is quite surprising that functions are defined 
> using ordinary
> > assignment, but function lookup is different from normal variable
> > evaluation, e.g. that after c<-4, c(10) is different from 
> (c)(10).  Was this
> > inspired by some other language? I don't think it's done 
> this way in any
> > other language I can think of....
> I think originally there was no difference, and it caused the obvious 
> trouble when people used variable names like t and c other short 
> function names, so this was added.  I don't remember whether the 
> different lookup rules showed up first in R or S.
> 
> Duncan Murdoch

Splus 3.4 (July 1996, based on SV3 dated "Apr 30 09:54:11 EDT 1992")
distinguished function vs. non-function lookups.  E.g.,

  > f <- function(a,b,c) c(a,b,c)
  > f(11,12,13)
  [1] 11 12 13
  Warning messages:
     looking for function "c", ignored local non-function in: f(11, 12,
13)

I don't have easy access to any older version of S+.  Somewhere along
the line we dropped the warning.

Bill Dunlap
TIBCO Software Inc - Spotfire Division
wdunlap tibco.com 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 



[Rd] Bug in subsetting data frame (PR#13515)
William Dunlap