Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Use scala high functions in JRuby!

View high_function.scala
1 2 3
object HighFunction {
def foo(num : Int)(f : Int => Int) = f(num)
}
View high_function.scala
1 2 3 4
require 'java'
import 'HighFunction' # make sure HighFunction.class & HighFunction$.class are in your path
 
HighFunction.foo(10) { |n| n * 2 } #=> 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.