W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1998

RE: Walking the DOM (was: XML APIs)

From: Miles Sabin <msabin@cromwellmedia.co.uk>
Date: Fri, 13 Nov 1998 17:21:58 -0000
Message-ID: <c=US%a=_%p=Cromwell_Media%l=ODIN-981113172158Z-22518@odin.cromwellmedia.co.uk>
To: "'John Cowan'" <cowan@locke.ccil.org>, "'DOM List'" <www-dom@w3.org>
John Cowan wrote,
> Miles Sabin wrote:
> > Even with a remove() operation on the iterator class, this
> > will still cause serious problems, because i will be
> > invalidated every time a node is removed via j.
> Agreed.  But other solutions are hardly better, since they
> involve using remove operations with at best O(log n) behavior.
> 1) You can't win;
> 2) You can't even break even.

Yes you can ...

We just have ultra simple iterators, and *document* the
conditions under which they remain valid, and rely on
programmers being smart enough to know when those
conditions hold and when they don't, or being able to
ensure they hold (with manual updates or synchronization,
or whatever).

I you're worried about the 'naive scripters' ... well,
maybe they should just be warned away from iterators
... if they _really_ are as naive as all that (which
I doubt).



Miles Sabin                          Cromwell Media
Internet Systems Architect           5/6 Glenthorne Mews
+44 (0)181 410 2230                  London, W6 0LJ
msabin@cromwellmedia.co.uk           England
Received on Friday, 13 November 1998 12:24:02 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:05 UTC