On 2013-03-14 14:42, Frank Church wrote: > domain better. For instance if you are iterating over an array where > elements are referenced by an integers, +1, +2 etc give the impression > your program involves number arithmetic, where as Next and Prev, or
And why I created and use an Iterator unit, which defines a standard "iterator interface" for many data types. A factory method will return the correct iterator interface to me. That way my code looks consistent no matter what data I iterate. I also have more control (HasNext, HasPrev, Next, Prev, Reset, Skip etc), and I can even iterate certain data using regex, so only regex matches are returned. Still doesn't change my mind about Inc(), Dec(), Pred(), Succ() etc. As I said, my personal opinion, and I think they make reading code harder. Your mileage my vary. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
