Swift Programming Language

31 thoughts
last posted Aug. 6, 2014, 9:41 p.m.

16 earlier thoughts


I'm not yet convinced of the value of external parameter names. I guess they only make sense if you want to keep Objective-C-like naming of named-args without the weirdness that can result from that in the function body.

EDIT: Ah, I see. It seems external parameter names are required if you want to call the function with explicit names and Swift lets you use a different name for that case than what you want to call it in the function body. There is the # syntax if the name in the function body is the same as the external parameter.

EDIT 2: In light of this, it seems a little odd that parameters with default values are automatically given external parameters names (without needing to use #).

14 later thoughts