Yeah, seems reasonable.

Thinking more about the nil parameter - does it make sense to make it optional and default to something reasonable like STDOUT? Or is it more likely that you would never intentionally pass a nil and a guard to alert the caller makes more sense? Can't quite decide.