Skip to content

Instantly share code, notes, and snippets.

@michalkowol
Last active December 31, 2015 22:39
Show Gist options
  • Save michalkowol/8055133 to your computer and use it in GitHub Desktop.
Save michalkowol/8055133 to your computer and use it in GitHub Desktop.
package pl.edu.agh.openshop
import pl.edu.agh.openshop.utils.fastfor
package object utils {
def fastfor(limit: Int)(f: Int => Unit) {
var i = 0
while (i < limit) {
f(i)
i += 1
}
}
}
object Example extends App {
fastfor(100) { i =>
println(i)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment