On Thu, 26 Oct 2017 21:54:37 -0700 Slava Pestov <[email protected]> wrote:

>
> Closures cannot replace all uses of local functions. Local functions can
> be recursive, and have a generic parameter list.
>
>
FTM, local functions do not help with "keep functions short" and "keep
indentation level small" rules of thumb.

what are the actual benefits of local vs non local functions? locality
principle? (define something where it is used). but we do not have it in
much more important cases, say, with static variables - we have to declare
them outside of functions. ditto for normal variables in extensions - no
matter how carefully i group functions in individual extensions based on
their purpose -- potentially in different files -- it all breaks once i
need to add a single variable to that group which i have to to in the class
itself.

what would be the damage if we remove local functions altogether, would we
lose anything really useful? aside from the fact that "it is too late at
this stage" i mean (which is appreciated).

Mike
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to