Created
December 9, 2008 09:33
-
-
Save jorgeortiz85/33855 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
jorge-ortizs-macbook-pro:tmp jeortiz$ cat Infix.scala | |
*/ | |
sealed abstract class LList[+T] | |
case object NNil extends LList[Nothing] | |
final case class :::[T](hd: T, tl: LList[T]) extends LList[T] | |
object Main extends Application { | |
val lst = "A" :: "B" :: Nil | |
val llst = "A" ::: "B" ::: NNil | |
println(lst) | |
println(llst) | |
} | |
/* | |
jorge-ortizs-macbook-pro:tmp jeortiz$ scalac Infix.scala | |
Infix.scala:7: error: value ::: is not a member of object NNil | |
val llst = "A" ::: "B" ::: NNil | |
^ | |
one error found | |
jorge-ortizs-macbook-pro:tmp jeortiz$ | |
jorge-ortizs-macbook-pro:tmp jeortiz$ scalac -version | |
Scala compiler version 2.7.2.final -- Copyright 2002-2008, LAMP/EPFL | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment