From wdunlap at tibco.com  Tue Apr 12 17:32:41 2011
From: wdunlap at tibco.com (William Dunlap)
Date: Tue, 12 Apr 2011 08:32:41 -0700
Subject: [Rd] all.equal(data.frame(package_version()),
	...) infinite recursion
Message-ID: <77EB52C6DD32BA4D87471DCD70C8D700041B3195@NA-PA-VBE03.na.tibco.com>

With R-2.12.2 on Linux:

  > z <- data.frame(Version=package_version(c("0.1")),
row.names=c("pkgA"))
  > all.equal(z, z) # expect TRUE
  Error: evaluation nested too deeply: infinite recursion /
options(expressions=)?
  > traceback()
  ... lots of lines in a 3-cycle ...
  6: all.equal.list(target, current, ...)
  5: all.equal.default(target[[i]], current[[i]], check.attributes =
check.attributes,
         ...)
  4: all.equal(target[[i]], current[[i]], check.attributes =
check.attributes,
         ...)
  3: all.equal.list(target, current, ...)
  2: all.equal.default(z, z)
  1: all.equal(z, z)

This is probably because the [[ method for package_version
([[.numeric_version)
acts like a typical [ method, not a [[ method, so all.equal's call to [[
does
not burrow into the list:
  > is.list(z$Version)
  [1] TRUE
  > identical(z$Version[[1]], z$Version)
  [1] TRUE

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com 



[Rd] all.equal(data.frame(package_version()), ...) infinite recursion
William Dunlap