From: Brian H. <bh...@sp...> - 2003-04-20 22:59:13
|
It's a cold, rainy, sunday afternoon and I'm bored- so I added the following functions to the Enum API: iter2, iter2i, foldi, fold2, fold2i, map2, map2i. The *i functions pass an index counter which counts from 0 to n through the enumeration. The 2 functions take two enumerations. Note that I'm not doing a lot of checking at the moment to make sure the two enumerations are the same length. The iterations stop when one interation runs out of elements. I took a swipe at adding pedantic checking- while it's possible, it's not pretty. Although most of the unprettiness came from handling unknown-length enumerations (this might be an argument against them)- I am more inclined that pedantic assertions that the two enumerations be the same length simply isn't that important. Brian |