The are two different way to implement it.
One is more short
implicit def toR1(s:String) = new { def getLength = s.length)}
Second is more long
class R2(s:String){def getLength2 = s.length)}
implicit def toR2(s:String) = new R2(s)
Which one is better?
implicit class R3(s:String) { def getLength = s.length }
:) I really hope that it will be included in Scala 2.10: docs.scala-lang.org/sips/pending/implicit-classes.html – Dutiable