Skip to content

Instantly share code, notes, and snippets.

@anoopelias
Created December 10, 2012 16:05
Show Gist options
  • Save anoopelias/4251496 to your computer and use it in GitHub Desktop.
Save anoopelias/4251496 to your computer and use it in GitHub Desktop.
Implicit variables in scala
package concept
object Impicit {
implicit val i : Int = 1 //> i : Int = 1
def add(a:Int)(implicit b:Int) = a + b //> add: (a: Int)(implicit b: Int)Int
add(10)(15) //> res0: Int = 25
add(10) //> res1: Int = 11
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment