Skip to content

Instantly share code, notes, and snippets.

@d6y
Created July 8, 2012 18:14
Show Gist options
  • Select an option

  • Save d6y/3072136 to your computer and use it in GitHub Desktop.

Select an option

Save d6y/3072136 to your computer and use it in GitHub Desktop.
Option(null) is None
for {
entry <- contacts
name <- Option(entry.getName)
full_name <- Option(name.getFullName)
birthday <- Option(entry.getBirthday)
when = birthday.getWhen
}
yield "%s: %s".format(full_name.getValue, when)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment