Re: New syntax in Xcode 12.5.


Alex Zavatone
 

The first half. Ternary has been there since time began. I’ve never seen this part be legitimate before.

let myVar = myVar != someValue


On Jul 26, 2021, at 10:09 AM, Jeremy Hughes via groups.io <moon.rabbit=virginmedia.com@groups.io> wrote:

Are you referring to the ternary conditional operator, which has existed in Swift since the beginning, or to the fact that it creates a local variable with the same name (myVar) as a parameter or member (myVar)?

Jeremy



On 26 Jul 2021, at 15:37, Alex Zavatone via groups.io <zav=mac.com@groups.io> wrote:

I just saw someone use this syntax in a project and haven’t see it before. It compiles in Xcode 12.5, but not in Xcode 12.4. Does anyone have any more details on it?

let myVar = myVar != someValue ? resultOne : resultTwo

Swift sure is getting muddier and muddier with regards to visual comprehension.

Thanks in advance.
Alex Zavatone




Join cocoa@apple-dev.groups.io to automatically receive all group messages.