[swift-evolution] Removing explicit use of `let` from Function Parameters

Erica Sadun erica at ericasadun.com
Fri Mar 18 09:33:27 CDT 2016


> On Mar 17, 2016, at 10:45 PM, Nicholas Maccharoli via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Thank you!
> 
> I have filed a PR here: https://github.com/apple/swift-evolution/pull/215 <https://github.com/apple/swift-evolution/pull/215>
> 
> How does it look?
> 
> - Nick
> 

Because the proposals act as documentation for the evolution process, I think it may be worth 
expanding the motivation section and the impact on existing code slightly.

You mention SE-0003 <https://github.com/apple/swift-evolution/blob/master/proposals/0003-remove-var-parameters.md> which removed var parameters and state "it would make sense 
that the syntax for function  parameters being explicitly declared as `let` would be removed as well."

I think it may be worth adding that SE-0001 <https://github.com/apple/swift-evolution/blob/master/proposals/0001-keywords-as-argument-labels.md> restricted `inout`, `var`, and `let` as argument labels. 
SE-0003 removed `var, and SE-0031 <https://github.com/apple/swift-evolution/blob/master/proposals/0031-adjusting-inout-declarations.md> moved `inout` declarations to the type, leaving `let` 
as the last remaining exception to SE-0001. Removing it reverts  SE-0001 to a clear implementation 
without special cases.

You might also mention `let` in its current use is redundant since its inclusion does not and 
cannot modify the behavior of the declaration it decorates. It is rarely if ever used and in the 
circumstances when added produces no positive contribution to  the language since the behavior 
is identical to its absence. 

In the Impact on Existing Code section, you suggest "The `let` keword would have to be deleted if 
placed before a function parameter." I'd recommend mentioning the migrator specifically and
adding that if not migrated, the let will be be now be interpreted as an external label.

-- E, who probably thought about this one a little too hard

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160318/a10b8478/attachment.html>


More information about the swift-evolution mailing list