func say(name:String, msg:String) {
println(\"\\(name) say \\(msg)\")
}
say(\"Henry\",\"Hi,Swift\") <---- error because missing argument label \'msg\' in ca
This is a quirk in the compiler. Functions (which are not members of a class) and class methods have different default behavior with regards to named parameters. This is consistent with the behavior of named parameters in objective-C (but makes no sense for someone new to swift with no experience with objective-C).
Here's what the language reference has to say about named parameters for functions (specifically parameters where an external name for the parameter is not given, and the parameter does not have a default value)
However, these parameter names are only used within the body of the function itself, and cannot be used when calling the function. These kinds of parameter names are known as local parameter names, because they are only available for use within the function’s body.
For information about class methods, see Logan's answer.