News for hackers. Stuff that matters.
Re:Swift System Is Now Open Source by santraginean on Saturday September 26, 2020 @12:34AM (#24596438)
They’re not dual identifiers; one is an argument label and the other is the parameter name. Maybe it’s because I come from an ObjC background, but this is one of my favorite aspects of the syntax; IMO it makes code way easier to read without having to look up method definitions to figure out what each argument does.
Re:Swift System Is Now Open Source by dmitriid on Saturday September 26, 2020 @02:53AM (#24596938)
From State of the Platform this year: https://pbs.twimg.com/media/Ebb51t6XkAIF4YD?format=jpg&name=...

Which for is for and would work as for for?

Re:Swift System Is Now Open Source by cutler on Saturday September 26, 2020 @03:48AM (#24597118)
Madness.
Re:Swift System Is Now Open Source by factotvm on Saturday September 26, 2020 @11:01AM (#24599331)
As a disclaimer, I’ve written Swift, but this seems to be a simple concept. The first name is the interface and is used at the call site, and the second (optional) name is used within the scope of the function, should the developer want a more descriptive name.