Skip to content

Instantly share code, notes, and snippets.

@rbobillot
Created April 22, 2015 18:16
Show Gist options
  • Save rbobillot/f79345197e67b3ea3dd4 to your computer and use it in GitHub Desktop.
Save rbobillot/f79345197e67b3ea3dd4 to your computer and use it in GitHub Desktop.
implicit def facto( x:Int ) = new {
def ! = (1 to x).foldLeft( BigInt(1) )( _ * _ )
}
println( 8! ) //equivaut a un simple appel de methode -> println( 8.! )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment