Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created September 18, 2011 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xuwei-k/1225117 to your computer and use it in GitHub Desktop.
Save xuwei-k/1225117 to your computer and use it in GitHub Desktop.
implicitsコマンド
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26).
Type in expressions to have them evaluated.
Type :help for more information.
scala> implicit def int2String(i:Int) = i.toString
int2String: (i: Int)java.lang.String
scala> :implicits
No implicits have been imported other than those in Predef.
scala> object A{
| implicit def int2String(i:Int) = i.toString
| }
defined module A
scala> :implicits
No implicits have been imported other than those in Predef.
scala> import A._
import A._
scala> :implicits
/* 1 implicit members imported from A */
/* 1 defined in A */
implicit def int2String(i: Int): jl.String
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment