--- a.swift
+++ a.swift
foo(
x: 0,
- y: 1
+ y: 1,
+ z: 2
)Trailing commas avoid this:
--- a.swift
+++ a.swift
foo(
x: 0,
y: 1,
+ z: 2,
)You’re arguing that you want to read Swift code written like this?
I wouldn't mind it.
I personally find that style repulsive :-) and I haven’t seen swift code commonly doing it. I’m not sure that we want to encourage it either.
Don't be too harsh :-) This style can be used with much profit when there are several closure arguments:
foo(
x: {
// several lines of code
},
y: {
// several lines of code
}
)
Sorry, but this kind of code writing evokes to me the kind of stream-of-consciousness-scripting I was happy to leave behind when I quit perl (or the one *modern* Javascript is ridden with). But I get it, it is an age old psych principle that it is easier for us to ask to be enabled than it is to self-discipline ourselves. I think it is an addiction lambdas have enabled... why would I have to think about the large scale structure of what I do when I can shove a bunch instructions as a parameter. don't get me wrong, i use lambdas a lot in java, but I use method references as soon as it starts to look smell like I am about to stuff all the logic as parameters.
Regards
LM
(From mobile)
···
On May 13, 2016, at 7:58 AM, Gwendal Roué via swift-evolution <swift-evolution@swift.org> wrote:
Le 13 mai 2016 à 07:01, Chris Lattner via swift-evolution <swift-evolution@swift.org> a écrit :
On May 12, 2016, at 4:50 PM, Joe Groff <jgroff@apple.com> wrote:
Gwendal Roué
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution