Skip to content

Instantly share code, notes, and snippets.

@jorgeortiz85
Created December 9, 2008 09:33
Show Gist options
  • Save jorgeortiz85/33855 to your computer and use it in GitHub Desktop.
Save jorgeortiz85/33855 to your computer and use it in GitHub Desktop.
/*
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