diff options
author | roberthoedicke <robert@duckbuddha.com> | 2014-10-08 23:33:29 +0200 |
---|---|---|
committer | roberthoedicke <robert@duckbuddha.com> | 2014-10-08 23:33:29 +0200 |
commit | a95c97d2bec7e833615ab6bc71eb3a7a53e89240 (patch) | |
tree | 903f48f4c432c5497b2a0e3fe7ac369981ae2b6d | |
parent | b7ce9e4c30721472ec9d83d1b700b6ac45b7e3db (diff) | |
download | scala-a95c97d2bec7e833615ab6bc71eb3a7a53e89240.tar.gz scala-a95c97d2bec7e833615ab6bc71eb3a7a53e89240.tar.bz2 scala-a95c97d2bec7e833615ab6bc71eb3a7a53e89240.zip |
Update 04-basic-declarations-and-definitions.md
Corrected the claimed outcome of the example in the section on repeated parameters. The example method sum sums up the _squares_ of the arguments.
-rw-r--r-- | spec/04-basic-declarations-and-definitions.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/04-basic-declarations-and-definitions.md b/spec/04-basic-declarations-and-definitions.md index ed7e4c625e..ad51182dec 100644 --- a/spec/04-basic-declarations-and-definitions.md +++ b/spec/04-basic-declarations-and-definitions.md @@ -726,7 +726,7 @@ def sum(args: Int*) = { ``` The following applications of this method yield `0`, `1`, -`6`, in that order. +`14`, in that order. ```scala sum() @@ -747,7 +747,7 @@ sum(xs) // ***** error: expected: Int, found: List[Int] ``` By contrast, the following application is well formed and yields again -the result `6`: +the result `14`: ```scala sum(xs: _*) |