Boy, was this an interesting trip.
For the last six days I was writing a series of articles on Delphi enumerators, one day each. In some way, this was very similar to something else I like to do - writing magazine articles on computer-related topics. So similar that I planned this series exactly as I'm planning an article. In some other way, it was also very different. Later posts I adapted based on feedback from earlier ones. For example, Part 6 was not included in the original article outline. This topic came to my mind while I was reading reader comments. In a way, it was like working with a very eager editor who is checking every chapter immediately I'm finished with it. Or, if you want, it was similar to pair programming.
In a way, writing this series was more like writing a book. If that's so, I have something more to write - a table of contents. It will help new readers to read whole series or just find the part they are interested in. So without further ado, here is the
Table of Contents
Contains a short introduction on Delph iterators (for..in statement) and describes Delphi support for iterator extensibility.
Shows how to add an additional enumerator to a class that already contains one.
This chapter takes Part 2 topic one level further by introducing enumerator parameters.
In this chapter you'll learn how to create enumerators without changing the class they are enumerating.
Shows how to create additional enumerators using class helpers and how to use same technique to add enumerators to classes that don't have one.
The last chapter shows how to write enumerators that work on their own data, not on some external structure. It also includes full source code of a demo program and all enumerators described in the series.
Make sure you'll also read comments to those posts - some quite interesting ideas are hidden there.
[If you liked my articles, feel free to tell others about them. Thanks!]
Hallvard Vassbotn posted interesting observations on enumerator performance in More fun with Enumerators.
Allen Bauer found a new use of the enumerator pattern in Stupid Enumerator Tricks - And now for something completely different.