Skip to content

[Revision] SE-0253: Introduce callables. #1037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 4, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor improvements.
  • Loading branch information
rxwei committed Apr 26, 2019
commit ae3a6dc94cd8d7a956dd1f67f26cc04fd7bf0bcc
6 changes: 3 additions & 3 deletions proposals/0253-callable.md
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,6 @@ struct Adder: Callable {

We feel this approach is not ideal for the same reasons as the marker type attribute. A marker protocol by itself is not meaningful and the name for call-syntax delegate methods is informal. Additionally, protocols should represent particular semantics, but call-*syntax* behavior has no inherent semantics.

In comparison, `call` methods have a formal representation in the language and exactly indicate callable behavior (unlike a marker attribute or protocol).

### Alternative names for call-syntax delegate methods

In addition to `call`, there are other names that can be used to denote the
Expand Down Expand Up @@ -599,8 +597,10 @@ called "function calls".
describing the precise functionality while not having a strong implication
about the function's side-effects.

> **call**:
> **call**
>
> _v._ Cause (a subroutine) to be executed.
>
> _n._ A command to execute a subroutine.

### Unify callable functionality with `@dynamicCallable`
Expand Down