On 17.9.2013 1:06, Jiří Zárevúcky wrote: > Because list_t feels too obscure to me. To me it's much easier to write > linked list manipulation in-line, and I think the resulting code is > clearer as well. Note that I did use list_t and list_foreach() until a > few days back, but after recent addition of two more magical arguments > to list_foreach() macro, I just didn't have the energy to go figure out > how it works. > > That being said, I would not oppose changing this back to list_t... but > for this one thing, I am not going to be the one doing the change.
Why wouldn't you? The entire HelenOS uses this one list, in order to avoid the list proliferation as we see e.g. in Solaris or Plan 9. In the very early stages of HelenOS, there was also a separate list implementation for each list. And guess what: it was quite error-prone. Besides, it is a really bad engineering practice to type this pattern over and over again. The new changes that got to your branch via merging from mainline were made by JiriS at the camp. See ticket #529: http://trac.helenos.org/ticket/529 The two new arguments make it easier to iterate over the list in most cases. In the more complex cases, you do not have to use list_foreach(). That's what list_first() and list_next() are for, so that you can walk the list semi-manually, but still don't have to care about inserting and removing items, and keeping the list in a consistent state. Jakub _______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/listinfo/helenos-devel
