Scala: drop elements from list based on position of elements : In Scala, what would be the right way of selecting elements of a list based on the position of two elements? Suppose I have the list below and I would like to select all the elements between 2 and 7, including them (note: not greater than/smaller than, but the elements that come after 2 and before 7 in the list):

```
scala> val l = List(1, 14, 2, 17, 35, 9, 12, 7, 9, 40)
l: List[Int] = List(1, 14, 2, 17, 35, 9, 12, 7, 9, 40)

scala> def someMethod(l: List[Int], from: Int, to: Int) : List[Int] = {
     | // some code here
     | }
someMethod: (l: List[Int], from: Int, to: Int)List[Int]

scala> someMethod(l, 2, 7)
res0: List[Int] = List(2, 17, 35, 9, 12, 7)
```