Skip to content
Prev 4446 / 63424 Next

all.equal.list() sometimes fails with unnamed and named components (PR#674)

R> x[["a"]]
R> x["a"]
R> x <- list(aa=1, bb=2, "NA"=3)
R> x["NA"]
The more I think about it, the less I am sure about what we really want.

In discussions with Fritz yesterday we noticed that quite often lists
are in fact used as hash tables; typically this is what is meant if all
components of the list have names.  Fritz suggested an option
	hash.order = FALSE
to all.equal.list() through which one could control the interpretation.
This option could also be passed on recursively.

I am not sure about this.  There is a difference between `typically' and
always.  Maybe we should have hash tables which can be implemented as
lists with class "hashtable".  This would be clean, but a substantial
change (e.g., most modelling functions in fact return hash tables in the
above sense) and I am not sure whether this is worth the effort.

We can fix the problems in the bug report by deleting the code in
all.equal.list() which compares the components.  That has the effect
that named components are referred to as positional even if their names
agree, and we should decide whether we want this or not.

-k
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._