Skip to content

Instantly share code, notes, and snippets.

@andrewharmellaw
Created May 21, 2013 19:56
Show Gist options
  • Save andrewharmellaw/5622717 to your computer and use it in GitHub Desktop.
Save andrewharmellaw/5622717 to your computer and use it in GitHub Desktop.
Scala :: syntax
koan("Lists reuse their tails") {
val d = Nil
val c = 3 :: d
val b = 2 :: c
val a = 1 :: b
a should be(List(1, 2, 3))
a.tail should be(b)
b.tail should be(c)
c.tail should be(d)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment