Skip to content

Instantly share code, notes, and snippets.

Created August 22, 2012 16:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
another scala
class Person(var firstName: String, var lastName: String, var address: Address) {
def this() = this(null, null, null)
class Address(var city: String, var street: String) {
def this() = this(null, null)
val persons = getAListSomewhere();
val filtered = for { p <- persons if == "Kyiv"} yield p
val adresses = (for { p <- persons } yield p.address).toSet
val filteredAdresses = (for { p <- persons if == "Kyiv" } yield p.address).toSet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment