Re: [Rd] identical on closures

2016-05-23 Thread Martin Maechler
> Mick Jordan > on Fri, 20 May 2016 14:23:13 -0700 writes: > On 5/20/16 2:00 PM, Gabriel Becker wrote: >> Specifically, the srcfile attribute of the srcref >> attribute of the two instances of the functions contain >> different environments, AFAICT. Environments are

Re: [Rd] identical on closures

2016-05-20 Thread Mick Jordan
On 5/20/16 2:00 PM, Gabriel Becker wrote: Specifically, the srcfile attribute of the srcref attribute of the two instances of the functions contain different environments, AFAICT. Environments are compared only by exact pointer, so this forces return FALSE. Thanks, and I realized that attrib

Re: [Rd] identical on closures

2016-05-20 Thread Gabriel Becker
Specifically, the srcfile attribute of the srcref attribute of the two instances of the functions contain different environments, AFAICT. Environments are compared only by exact pointer, so this forces return FALSE. Snippets from .Internal(inspect(x)) and .Internal(inspect(y)): @cca008 03 CLOSXP

Re: [Rd] identical on closures

2016-05-20 Thread Mick Jordan
On 5/20/16 12:40 PM, Mick Jordan wrote: I'm confused by this: > identical(function() {}, function() {}) [1] FALSE Yet, after loading the Matrix package (which redefines det), the following is checked (in library.checkConflicts): > identical(get("det", baseenv()), get("det", asNamespace("Matr

[Rd] identical on closures

2016-05-20 Thread Mick Jordan
I'm confused by this: > identical(function() {}, function() {}) [1] FALSE Yet, after loading the Matrix package (which redefines det), the following is checked (in library.checkConflicts): > identical(get("det", baseenv()), get("det", asNamespace("Matrix")), ignore.environment=T) [1] TRUE