Skip to content

Instantly share code, notes, and snippets.

@rssh
Last active August 29, 2015 14:06
Show Gist options
  • Save rssh/b7a4c9ec9790295b69f9 to your computer and use it in GitHub Desktop.
Save rssh/b7a4c9ec9790295b69f9 to your computer and use it in GitHub Desktop.
jdv_article6 (scala lambda expression with modification of context)
var (maxFirstLen, maxSecondLen) = (0,0)
list.foreach{
x => maxFirstLen = max(maxFirstLen, x.firstName.length)
maxSecondLen = max(maxSecondLen, x.secondName.lenght)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment