SID

Scala Improvement Documents, http://www.scala-lang.org/sids



Version: 2.8

命名與預設參數 (Named and Default Arguments), SID#1


Named and default arguments were added to Scala in version 2.8.
Named arguments improve the readability of method calls with many arguments, and they can avoid traps when a method has many parameters of the same type.

Default arguments are a nice feature to reduce code duplication (e.g. ad-hoc polymorphism aka overloading) and they enable the implementation of a "copy" method for case classes. This method can be used to quickly generate modified copies of instances of a case class.

Document: 



新集合類別 (New Collection Classes), SID#3


It has been consensus for a while that Scala's current collection classes leave some room for improvement. They sufferered from inconsistencies and some lack of functionality. The main problem was that there was no unique design principle supported by a framework in which individual collections could be easily integrated. Therefore, contributions over time increased entripy and caused various inconsistencies.

The current proposal is an attempt at a uniform design, which maximizes sharing and code reuse. The ambition is that every piece of functionality should have one and only one logical place to reside. We are not quite there yet, but we are already quite far towards this goal.

Document: 


子網頁 (1): 集合類別架構
Comments