I don't like the idea of making call-syntax delegate methods have no name. I think that anonymous function declarations (func _(...)
) should be reserved for other potential language features that use a function declaration to extend an existing function's behavior, such as dynamic method replacement and differentiable programming. In these use cases, the function declarations do not need a name.
@dynamicallyReplacing(foo)
dynamic func _() { ... }
@differentiating(sinf(_:))
func _(x: Float) -> (value: Float, differential: (Float) -> Float) { ... }