OT: Swift is now open source

rcorre via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 4 04:35:58 PST 2015


On Friday, 4 December 2015 at 03:38:23 UTC, Steven Schveighoffer 
wrote:

> 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

Do you mean something like:

enum Foo { bar, baz }
void fun(Foo foo) { }

fun(baz);

I don't really mind having to use switch/with but I've found 
myself wishing for the above on occasion.


More information about the Digitalmars-d mailing list