> Why don't you use a class ? Because we use this pattern for thousands of functions, and don't want thousands of new classes. Right now we use a single class that creates an instance for each such generator. I was hoping to find a way to get even more lightweight than that. :-)