Paul Graham's Accumulator Generator, in PostScript

2005-07-25

In Revenge of the Nerds, Paul Graham defines the accumulator generator problem. Solving it requires using a programming language that has, or can simulate, closures and a polymorphic add function. He presents solutions in a number of languages, submitted by various people.

He's no longer accepting solutions, but I managed to solve it in PostScript anyway: