From: Christophe T. <Chr...@um...> - 2005-05-27 18:48:58
|
On Fri, 27 May 2005, John Skaller wrote: > > On Fri, 2005-05-27 at 12:06 +0200, Christophe TROESTLER wrote: > > On Thu, 26 May 2005, Brian Hurt <bh...@sp...> wrote: > > > > > > On Wed, 25 May 2005, Christophe TROESTLER wrote: > > > > > > > Is there a good reason (aside from implementation easiness) > > > > not to allow Dllist to be empty? IMHO, empty lists are very > > > > useful and it is rather an hindrance that Dllists cannot be. > > > > > > My original implementation did allow for empty lists, but it got > > > overridden. > > > > Where? The CVS version does not seem to allow it. > > Originally, the dlists had 'header' objects. No sure what you mean precisely by that. > I think I'm responsible for arguing that this is too complex, the > lists should be made from a single simple data structure. Can you explain a bit more your point? IMO, when one designs a library for wide use, one should take care about simplicity of the interface, usability and (if relevant) performance. If that means a bit more of coding, that's not a big deal. Here the usability is at stake: I think a [mutable,...] list that cannot be empty is not nearly as useful as one that can. > As such, an empty list cannot be represented: use dlist opt > if you want possibly empty dlists. And redefine every single function of the module to cope with that! That defeats the purpose of using the library doesn't it. ChriS |