In David Pollak's book, Beginning Scala, he introduces a
using control structure that is helpful in several ways. First, it can be used to automatically close any resource that has a
close method. Second, it's a great example of how to create a custom control structure in Scala.
Here's the source code for the
using control structure he created: