> Martin Maechler
> on Thu, 3 Dec 2020 18:29:58 +0100 writes:
> Martin Maechler
> on Tue, 1 Dec 2020 10:31:36 +0100 writes:
> Bill Dunlap
> on Mon, 30 Nov 2020 13:41:54 -0800 writes:
>>> To make the comparison more complete,
>>> all.equal.environmen
> Martin Maechler
> on Tue, 1 Dec 2020 10:31:36 +0100 writes:
> Bill Dunlap
> on Mon, 30 Nov 2020 13:41:54 -0800 writes:
>> To make the comparison more complete,
>> all.equal.environment could compare the parents of the
>> target and current environments. Th
> Bill, I'm sure you've noticed that we did write all.equal.environment()
> to work recursively... Actually, I had worked quite a bit at
> that, too long ago to remember details, but the relevant svn log
> entry is
>
> r66640
One more comment: it might be worthwhile reporting on a case where
identical(e1, e2) fails when those are the environments associated with
two functions (though I think not by default in all.equal.environment).
Functions can modify variables in their environment, so examples like
the open.acc
Probably all.equal.environment's do1() could be enhanced to do the
recursion (and look at the environments' attributes). I wrote a separate
function because it was easier to experiment that way (e.g., when to stop
recursing - it stops when one environment is a top-level environment or the
empty en
> Bill Dunlap
> on Mon, 30 Nov 2020 13:41:54 -0800 writes:
> To make the comparison more complete, all.equal.environment could compare
> the parents of the target and current environments. That would have to be
> recursive but could stop at the first 'top level environmen
To make the comparison more complete, all.equal.environment could compare
the parents of the target and current environments. That would have to be
recursive but could stop at the first 'top level environment' (the global,
empty, or a package-related environment generally) and use identical
there.
On 30/11/2020 1:05 p.m., Kevin Van Horn via R-devel wrote:
Consider the following code:
f <- function(x)function(y){x+y}
all.equal(f(5), f(0))
This returns TRUE, when it should return FALSE; I think it’s hard to make the
case that f(5) and f(0) are “approximately equal” in any meanin
Consider the following code:
f <- function(x)function(y){x+y}
all.equal(f(5), f(0))
This returns TRUE, when it should return FALSE; I think it’s hard to make the
case that f(5) and f(0) are “approximately equal” in any meaningful sense.
Digging into the code for all.equal(), I see that