Created
May 11, 2011 00:37
-
-
Save iwazer/965686 to your computer and use it in GitHub Desktop.
可変長引数の渡し方
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def a(ss: String*) = ss.toList.foreach(println(_)) | |
// Error!! | |
// def b(ss: String*) = a(ss) | |
// Success | |
def b(ss: String*) = a(ss:_*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment