这对我来说似乎是错误的 - 为什么元素的顺序与它们的构建顺序不同?
scala> var list = collection.immutable.TreeSet(1, 3, 2, 5, 0)
list: scala.collection.immutable.TreeSet[Int] = TreeSet(0, 1, 2, 3, 5)
scala> var xml = <list>{ list.map(number => { <number>{number}</number> }) }</list>
xml: scala.xml.Elem = <list><number>3</number><number>1</number><number>2</number><number>5</number><number>0</number></list>
scala> var xml = <list>{ list.map(number => { println(number); <number>{number}</number> }) }</list>
0
1
2
3
5
xml: scala.xml.Elem = <list><number>3</number><number>1</number><number>2</number><number>5</number><number>0</number></list>