Skip to content

Instantly share code, notes, and snippets.

@yuroyoro
Created May 21, 2010 07:44
Show Gist options
  • Save yuroyoro/408589 to your computer and use it in GitHub Desktop.
Save yuroyoro/408589 to your computer and use it in GitHub Desktop.
scala> class S[A]( val theSeq:Seq[A] ) extends Seq[A]{
| def apply(n:Int ) = theSeq(n)
| def length = theSeq.length
| override def iterator = theSeq.iterator
| override def toString = "hogehoge"
| }
defined class S
scala> new S( List("foo","bar"))
res15: S[java.lang.String] = line35(foo, bar)
scala> res15.toString
res16: java.lang.String = hogehoge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment