I've been porting a fun little demo program from C to Smalltalk lately. It's simple, straightforward, easy to follow. Makes use of some of the GTK libraries and facilities. One thing just amuses me about it though. It's trying very hard to be like one of those "closureful" programs.
In the UI portion of the program, it has some "stuff" that needs to show up in all or port, and the state of which must evolve, that gets passed from function to function. It's a multivariable structure. Typedef'ed as "Closure". These functions take 'void data*' arguments, which they cast as 'Closure*' on the first line. Elsewhere in the same file is a DockInitClosure. The Model of the thing has a bunch of lists of different things, and it has a bunch of enumeration functions which you pass a function pointer, said function will have as it's first argument, and as it's second argument a.... yep, you guessed it: 'void *data'. And each time, there's some sort of "closure" typedef'ed structure to pass context for the enumeration. Things like ObjectConstrainPolygonClosure and FindNearestClosure. How we take do: for granted!
In the end, I don't know whether to be amused and flattered, or grateful, or sympathetic. Block closures are one of the penultimate wonders of Smalltalk. They're so terse and simple and completely powerful. So I could feel sorry that this person had to use this very limited way of emulating closures. Or I could be amused at the flattery "to be like one of those high falutin' closure languages" implied. Or just plain grateful, because it makes the port that much simpler, because the concepts are closer. Maybe a little of all I guess.
Aside: After running this post through Gender Genie, I'm happy to report that this blog post is decidely masculine by a factor of 4:1. Whew.