Skip to content

Instantly share code, notes, and snippets.

@tototoshi
Created December 17, 2012 15:34
Show Gist options
  • Save tototoshi/4319159 to your computer and use it in GitHub Desktop.
Save tototoshi/4319159 to your computer and use it in GitHub Desktop.
break, continue in scala
#!/bin/sh
exec scala "$0" "$@"
!#
import util.control.Breaks
val continue = new Breaks
Breaks.breakable {
for (i <- 1 to 10) {
continue.breakable {
if (i % 2 == 0){
continue.break
}
println(i)
if (i == 7) {
Breaks.break
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment