「ProgramminginScala」の44ページによると、データ構造のremove
関数があります。list
ただし、インタープリターで例を試してみると、エラーが発生し続けます。誰かが理由を知っていますか?これがサンプルです
scala> val x = List(1,2,3,4,5,6,7,8,9)
x: List[Int] = List(1, 2, 3, 4, 5, 6, 7, 8, 9)
scala> x.remove(_ < 5)
<console>:9: error: value remove is not a member of List[Int]
x.remove(_ < 5)
^
scala> x.remove(s => s == 5)
<console>:9: error: value remove is not a member of List[Int]
x.remove(s => s == 5)
^
scala> val y = List("apple","Oranges","pine","sol")
y: List[String] = List(apple, Oranges, pine, sol)
scala> y.remove(s => s.length ==4)
<console>:9: error: value remove is not a member of List[String]
y.remove(s => s.length ==4)