work from The Ruby Programming Language, O'Reilly, by David Flanagan and Yukihiro Matsumoto