OT: Swift is now open source
Steven Schveighoffer via Digitalmars-d
digitalmars-d at puremagic.com
Thu Dec 3 19:38:23 PST 2015
On 12/3/15 10:22 PM, rsw0x wrote:
> On Friday, 4 December 2015 at 03:18:02 UTC, Steven Schveighoffer wrote:
>> On 12/3/15 9:59 PM, tcak wrote:
>>> [...]
>>
>> It is meant to be a replacement for Objective C. I'd put it more at
>> the C level, but there are something that are very UNLIKE C. For
>> example, they do not have any direct instance variables, everything is
>> a property. There seem to be no low-level types, even 'Int' is a
>> struct. But I assume the compiler whisks that away.
>>
>> [...]
>
> switch(foo) with foo
> {
> case Bar:
> case Baz:
> }
>
Yes, I know that trick. In swift, everywhere you are using/expecting a
Foo, it allows the shortcut.
It's very nice when you are doing things that require a lot of enum
function parameters (UI has a lot of this).
-Steve
More information about the Digitalmars-d
mailing list