let foo = bar()
switch foo {
case foo0: print(foo.description)
case foo1: print(foo.name)
...
Could it be abbreviated so that I don't have to declare the "let"?
switch bar() {
case foo0: print($0.description)
case foo1: print($0.name)
...
Not in the language as its currently designed. You have a couple of choices here:Could it be abbreviated so that I don't have to declare the let?
If you’d like to explore better solutions within the existing language, the best place for that is Swift Forums > Using Swift. I’m happy to talk Swift here but you’ll get more traction over there.
If you’d like the language to change to support this feature, you can raise it over in Swift Forums > Evolution.
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"