- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
SID # 1 - Named and Default Arguments
Created by rytz on 2009-05-27.
Updated: 2010-01-22, 18:05
Scala Improvement Document # 1
Revision: 7 - Date: 2010-01-22
Status:
active
SID:
Named and Default Arguments 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: