I have a feeling I\'m missing something very obvious here. I\'m converting a compiler generator written in Java into Scala as a learning exercise.开发者_如何学Python
I have a ListBuffer. I want to remove all elements that meet a certain condition. I could iterate over it and remove each element. But what doe Scala say about mutating a list that you are iterating
This code v(2,1) var m=Array[String]() def v(f:Int,t:Int)= {var move= (10*f+t).toString m :+ \"21\" } (run it as a scala script)
As an exercise, I\'d like to extend the Scala Array collection to my own OneBasedArray (does what you\'d expect, indexing starts from 1).Since this is an immutable collection, I\'d like to have it ret
scala noob here, i have a collection (Seq) of xml nodes, and i would like to populate an Array based on each node:
I 开发者_C百科have a string that looks like this: \"7-6-4-1\" or \"7\" or \"\" That is, a set of numbers separated by -. There may be zero or more numbers.
I\'ve a three-level data structure (indentation and line breaks for readability): scala> import scala.collection.mutable.Map
What should \",7-6-5-4-3-2-1,\".split(\',\') return? It seems to return blank string 7-6-5-4-3-2-1 ie. two strings. I\'d expect either one or three str开发者_开发知识库ings - that is a blank stri
How do you use Map.foldLeft?According to the docs it looks like foldLeft [B] (z: B)(op: (B, (A, B)) ⇒ B) : B
I开发者_StackOverflow社区\'m experiencing an odd bit of behavior when I use the auto-generated copy() method that was added in Scala-2.8.