Skip to content

Instantly share code, notes, and snippets.

@zcox
Created February 3, 2010 15:07
Show Gist options
  • Save zcox/293666 to your computer and use it in GitHub Desktop.
Save zcox/293666 to your computer and use it in GitHub Desktop.
def using[A <: {def close(): Unit}, B](param: A)(f: A => B): B =
try {
f(param)
} finally {
param.close()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment