Swift Programming Language

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

5 earlier thoughts


They've gone with:

for (foo, bar) in baz

meaning baz is a dictionary, foo the key and bar the value.

I guess that's because they don't have lists of tuples and so baz couldn't be a list of tuples (like the above would be interpreted in Python)

EDIT: I think they do have lists of tuples so I guess they just don't have Python's tuple unpacking.

EDIT 2: Oh wait, they do have tuple unpacking. So how does the above work? Maybe it works one way with dictionaries and another way with lists?

25 later thoughts