# Unwrapped Arguments for Functions

**URL:** <https://forums.swift.org/t/unwrapped-arguments-for-functions/28548>\
**Category:** Pitches\
**Tags:** optional\
**Created:** [September 5, 2019, 2:38pm UTC](https://forums.swift.org/t/unwrapped-arguments-for-functions/28548 "2019-09-05T14:38:55Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![mayoff](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mayoff/32/613_2.png) [@mayoff](https://forums.swift.org/u/mayoff)\
**Post date:** [September 5, 2019, 3:35pm UTC](https://forums.swift.org/t/unwrapped-arguments-for-functions/28548/5 "2019-09-05T15:35:43Z")

</div>

This has been proposed several times before. Here are some of the prior discussions:

> [@Skip function call when required parameter is nil?](https://forums.swift.org/t/skip-function-call-when-required-parameter-is-nil/17664):
>
> This would be similar to using x?.m() to skip a method call when the object x is nil. As for syntax, perhaps you could try m(x, y?, z) to indicate that y may be nil even though the corresponding formal parameter is not an optional. The return type of m would be turned into an optional if necessary.

> [@Optional Argument Chaining](https://forums.swift.org/t/optional-argument-chaining/7237):
>
> Hi all, I'd like to propose a syntax addition that acts to ease some things that I believe should fall under the umbrella of 'optional chaining'. Optional chaining allows us to access the properties of an optional value and return nil if any link in that chain breaks. I propose we introduce syntax to allow similar chaining when passing optional valued parameters to functions that expect that parameter to be non-optional. The example below is taken from a project I'm working on at the moment: /…

[https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160711/024201.html](https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160711/024201.html)

> [@Add nil-collapsing call expression](https://forums.swift.org/t/add-nil-collapsing-call-expression/14634/2):
>
> If throw becomes an expression of type Never and Never becomes a true bottom type, you'd be able to write this as: try? quixify(foo: acquireFoo() ?? throw CannotAcquireFoo, bar: acquireBar() ?? throw CannotAcquireBar, baz: acquireBaz()) Of course you could also use plain try and handle the errors explicitly as well.

---

_[View the full topic](https://forums.swift.org/t/unwrapped-arguments-for-functions/28548)._
