# Pitch: Multi-statement if/switch/do expressions

**URL:** <https://forums.swift.org/t/pitch-multi-statement-if-switch-do-expressions/68443>\
**Category:** Pitches\
**Created:** [November 14, 2023, 1:07am UTC](https://forums.swift.org/t/pitch-multi-statement-if-switch-do-expressions/68443 "2023-11-14T01:07:11Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![jeremyabannister](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jeremyabannister/32/10143_2.png) [@jeremyabannister](https://forums.swift.org/u/jeremyabannister)\
**Post date:** [November 14, 2023, 2:08pm UTC](https://forums.swift.org/t/pitch-multi-statement-if-switch-do-expressions/68443/21 "2023-11-14T14:08:24Z")

</div>

~~What about simply allowing other expressions as long as they evaluate to `()`?~~

```swift
let backgroundColor: Color =
    switch colorScheme {
    case .light: .white
    case .dark: .charcoal
    @unknown default:
    // Upon writing this I realized that it
    // would parse as `Void.white`, and that
    // therefore we should have some keyword or sigil...
        log("Unrecognized `colorScheme`: \(colorScheme)")
        .white
    }

```

I'll throw `->` into the ring for consideration, even though leaving aside the stylistic question it might be completely untenable just in terms of parsing complexity:

```swift
let backgroundColor: Color =
    switch colorScheme {
    case .light: .white
    case .dark: .charcoal
    @unknown default:
        log("Unrecognized `colorScheme`: \(colorScheme)")
        -> .white
    }

```

---

_[View the full topic](https://forums.swift.org/t/pitch-multi-statement-if-switch-do-expressions/68443)._
