Skip to content

Instantly share code, notes, and snippets.

@wrobstory
Created February 5, 2015 00:47
Show Gist options
  • Save wrobstory/35ea4eb1bae8ebdee0b5 to your computer and use it in GitHub Desktop.
Save wrobstory/35ea4eb1bae8ebdee0b5 to your computer and use it in GitHub Desktop.
Scala Queue Take
scala> import scala.collection.mutable.Queue
import scala.collection.mutable.Queue
scala> var newQ = Queue(1, 2, 3, 4, 5)
newQ: scala.collection.mutable.Queue[Int] = Queue(1, 2, 3, 4, 5)
scala> newQ.take(3)
res0: scala.collection.mutable.Queue[Int] = Queue(1, 2, 3)
scala> newQ
res1: scala.collection.mutable.Queue[Int] = Queue(1, 2, 3, 4, 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment