From mick.jordan at oracle.com  Wed Dec 17 18:17:29 2014
From: mick.jordan at oracle.com (Mick Jordan)
Date: Wed, 17 Dec 2014 09:17:29 -0800
Subject: [Rd] vapply definition question
In-Reply-To: <54911A87.8010905@fredhutch.org>
References: <5491047E.2060704@oracle.com> <54911A87.8010905@fredhutch.org>
Message-ID: <5491BAA9.9040903@oracle.com>


On 12/16/14, 9:54 PM, Martin Morgan wrote:
> Hi Mick --
>
> You can see that the source code doesn't contain '...' in the final line
>
> ~/src/R-devel/src/library/base/R$ svn annotate lapply.R | grep 
> Internal\(l
>  38631     ripley     .Internal(lapply(X, FUN))
>
> and that it's been there for a long time (I'd guess 'forever')
>
> ~/src/R-devel/src/library/base/R$ svn log -r38631
> ------------------------------------------------------------------------
> r38631 | ripley | 2006-07-17 14:30:55 -0700 (Mon, 17 Jul 2006) | 2 lines
>
> another attempt at a faster lapply
>
> ------------------------------------------------------------------------
>
> so I guess you're looking at a modified version of the function... The 
> implementation detail is in the comment -- FUN(X[i], ...) is evaluated 
> in the frame of lapply.
>
Oh dear, my apologies. It seems that, indeed, we had modified lapply.R 
(and sapply.R) to add the "...". Ironic in that I am going through the 
base code and trying to remove all the changes that we made as our 
implementation was developing, and somehow I missed that one. It's a 
minor nuisance to have to special case the "..." not being passed, but 
we can work around it.

Thanks
Mick



[Rd] vapply definition question
Mick Jordan