- From: Miles Sabin <msabin@cromwellmedia.co.uk>
- Date: Fri, 13 Nov 1998 17:21:58 -0000
- 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). Cheers, Miles -- 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