<commit_before># Callable values of user-defined nominal types

* Proposal: [SE-0253](https://github.com/apple/swift-evolution/blob/master/proposals/0253-callable.md)
* Authors: [<NAME>](https://github.com/rxwei), [<NAME>](https://github.com/dan-zheng)
* Review Manager: [<NAME>](https://github.com/lattner)
* Status: **[Active review](https://forums.swift.org/t/se-0253-callable-values-of-user-defined-nominal-types/24177?u=chris_lattner3) through May 13, 2019**
* Implementation: [apple/swift#24299](https://github.com/apple/swift/pull/24299)
* Previous Revisions: [[1](https://github.com/apple/swift-evolution/blob/36ea8be09508db9380949954d0c7a101fdb15226/proposals/0253-callable.md)]
* Decision Notes: [Rationale](https://forums.swift.org/t/returned-for-revision-se-0253-static-callables/23290)

## Introduction

This proposal introduces "statically"
[callable](https://en.wikipedia.org/wiki/Callable_object) values to Swift.
Callable values are values that define function-like behavior and can be called
using function call syntax. In contrast to dynamically callable values
introduced in
[SE-0216](https://github.com/apple/swift-evolution/blob/master/proposals/0216-dynamic-callable.md),
this feature supports statically declared arities, argument labels, and
parameter types, and is not constrained to primary type declarations.

In a nutshell, values that have a method whose base name is `call` (referred to
as a "`call` method" for the rest of this proposal) can be called like a
function. The function call syntax forwards arguments to the corresponding
`call` method.

```swift
struct Adder {
    var base: Int
    func call(_ x: Int) -> Int {
        return base + x
    }
}
<commit_msg>[SE-0253] Fix "missing or invalid proposal status"<commit_after># Callable values of user-defined nominal types

* Proposal: [SE-0253](0253-callable.md)
* Authors: [<NAME>](https://github.com/rxwei), [<NAME>](https://github.com/dan-zheng)
* Review Manager: [<NAME>](https://github.com/lattner)
* Status: **Active review (May 5...May 13)**
* Implementation: [apple/swift#24299](https://github.com/apple/swift/pull/24299)
* Previous Revisions: [[1](https://github.com/apple/swift-evolution/blob/36ea8be09508db9380949954d0c7a101fdb15226/proposals/0253-callable.md)]
* Decision Notes: [Rationale](https://forums.swift.org/t/returned-for-revision-se-0253-static-callables/23290)

## Introduction

This proposal introduces "statically"
[callable](https://en.wikipedia.org/wiki/Callable_object) values to Swift.
Callable values are values that define function-like behavior and can be called
using function call syntax. In contrast to dynamically callable values
introduced in
[SE-0216](https://github.com/apple/swift-evolution/blob/master/proposals/0216-dynamic-callable.md),
this feature supports statically declared arities, argument labels, and
parameter types, and is not constrained to primary type declarations.

In a nutshell, values that have a method whose base name is `call` (referred to
as a "`call` method" for the rest of this proposal) can be called like a
function. The function call syntax forwards arguments to the corresponding
`call` method.

```swift
struct Adder {
    var base: Int
    func call(_ x: Int) -> Int {
        return base + x
    }
}

{'fraction_non_alphanumeric': 0.12679938744257274, 'fraction_numerical': 0.04869831546707504, 'mean_word_length': 4.992660550458716, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2853892', 'n_tokens_mistral': 1143, 'n_tokens_neox': 1005, 'n_words': 283}