> On Jul 28, 2017, at 12:19 PM, Kwanghoon Choi via swift-evolution
> wrote:
>
> Hello
>
> I found someone easy mistake using for in loop statement.
>
> Ex)
> var i = 0
> for i in 0..<10 { }
> print(i)
>
> And this user expected print(i) is “10”
>
> Many experienced swift developers doesn’t
Thanks for all replies.
This is helpful for introduce why for in be that for in other peoples.
나의 iPhone에서 보냄
2017. 7. 29. 05:14 Taylor Swift 작성:
> This is funny because this “expected behavior” is actually a heavily
> criticized part of C behavior. I think this change would cause just as muc
This is funny because this “expected behavior” is actually a heavily
criticized part of C behavior. I think this change would cause just as much
if not more confusion than it alleviates.
On Fri, Jul 28, 2017 at 12:19 PM, Kwanghoon Choi via swift-evolution <
swift-evolution@swift.org> wrote:
> Hel
> On 28 Jul 2017, at 17:19, Kwanghoon Choi via swift-evolution
> wrote:
>
> Hello
>
> I found someone easy mistake using for in loop statement.
>
> Ex)
> var i = 0
> for i in 0..<10 { }
> print(i)
>
> And this user expected print(i) is “10”
>
> Many experienced swift developers doesn’t misu
I simply can’t see changing the syntax of such a fundamental construct,
especially when a suitable replacement, which accomplishes your desired goal of
introducing no new variables outside (visually) of a pair of curly braces,
already exists. The language’s development is well past the stage of
yes, swift already has forEach, but from my point of view, there is an
uncomfortable part, like '(0..<10).forEach{}'. like Range type to need wrap
it in parentheses for using forEach.
my suggestion is not replacing 'for in [] {}' to 'for [] {}'. Can not we
have both? Of course, by erasing one befo
Isn’t this exactly like forEach, which is already in the language?
> On Jul 28, 2017, at 12:32 PM, Jacob Williams via swift-evolution
> wrote:
>
> This change would also make it so that for loops follow the same format as
> all other closures with variables.
>
> The downside is that this woul
This change would also make it so that for loops follow the same format as all
other closures with variables.
The downside is that this would break a TON of code. I don’t think that the
amount of code this breaks would be worth the consistency. And as Alex
mentioned, it is possible through .for
> On 28 Jul 2017, at 17:19, Kwanghoon Choi via swift-evolution
> wrote:
>
> Hello
>
> I found someone easy mistake using for in loop statement.
>
> Ex)
> var i = 0
> for i in 0..<10 { }
> print(i)
>
> And this user expected print(i) is “10”
The variable shadows any reference in the loop; and
Hello
I found someone easy mistake using for in loop statement.
Ex)
var i = 0
for i in 0..<10 { }
print(i)
And this user expected print(i) is “10”
Many experienced swift developers doesn’t misunderstand like this. But always
someone is new comers, and I think this expression make misunderstand
10 matches
Mail list logo