From ripley at stats.ox.ac.uk  Sun Sep  3 07:07:08 2006
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sun, 3 Sep 2006 06:07:08 +0100 (BST)
Subject: [Rd] [<-.POSIXlt changes order of attributes (PR#9197)
In-Reply-To: <44F9E342.9050900@bfro.uni-lj.si>
References: <20060901115839.3758019A05@slim.kubism.ku.dk>
	<Pine.LNX.4.64.0609011416490.11719@gannet.stats.ox.ac.uk>
	<44F9E342.9050900@bfro.uni-lj.si>
Message-ID: <Pine.LNX.4.64.0609030604590.10774@gannet.stats.ox.ac.uk>

On Sat, 2 Sep 2006, Gregor Gorjanc wrote:

> Hello,
> 
> Prof Brian Ripley wrote:
> > Please point us to the documentation that says attributes are ordered.
> > E.g. R-lang.texi says
> > 
> >   All objects except @code{NULL} can have one or more attributes attached
> >   to them.  Attributes are stored as a list where all elements are named.
> > 
> > (although in fact they are stored in a pairlist).
> > 
> > I know of tens of functions that change the order of attributes, and 
> > did look at teaching identical() that they are not ordered.  But 
> > since they are stored as a pairlist, it would be quite expensive.
> 
> I agree that there is no need for attributes to be always in the same
> order as this is tedious to achieve as you noted above, but identical()
> seems to care about this.
> 
> > (Given that attributes seem to be growing in use, another internal storage 
> > mechanism is becoming more appropriate.)
> 
> Which internal storage mechanism are you talking about here?

The one mentioned at

	'Attributes are stored as a list'

(but in fact a pairlist). We may want to change to e.g. a hash table.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




[Rd] [<-.POSIXlt changes order of attributes (PR#9197)
Prof Brian Ripley