# \[Pitch\] Last expression as return value

**URL:** <https://forums.swift.org/t/pitch-last-expression-as-return-value/76958>\
**Category:** Pitches\
**Created:** [January 2, 2025, 12:37am UTC](https://forums.swift.org/t/pitch-last-expression-as-return-value/76958 "2025-01-02T00:37:10Z")\
**Posts on this page:** 1\
**Showing post:** 133

<div class="post-metadata">

**Author:** ![georgeef](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/georgeef/32/38378_2.png) [@georgeef](https://forums.swift.org/u/georgeef)\
**Post date:** [January 5, 2025, 2:12am UTC](https://forums.swift.org/t/pitch-last-expression-as-return-value/76958/133 "2025-01-05T02:12:53Z")

</div>

Another option is to collect only the first value in a loop, which makes more sense if "some\_keyword\_here" means "return". This option would need an extension of the syntax with an else part (see [comment in previous pitch](https://forums.swift.org/t/pitch-multi-statement-if-switch-do-expressions/68443/478)).  
It would also allow while loops, which may not end otherwise. Or double loops, or more complex control structures.

---

_[View the full topic](https://forums.swift.org/t/pitch-last-expression-as-return-value/76958)._
