Skip to content

Instantly share code, notes, and snippets.

@eernstg
Created August 27, 2017 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eernstg/e48a8d9e33f16a6f0b4659aabe59ca46 to your computer and use it in GitHub Desktop.
Save eernstg/e48a8d9e33f16a6f0b4659aabe59ca46 to your computer and use it in GitHub Desktop.
Informal specification: Dispatching parameters.

Dispatching Parameters

Author: eernst@

Status: Under discussion.

This document is an informal specification of the dispatching parameter feature in Dart. That feature allows a function parameter to implicitly serve as the receiver for member accesses (e.g., calling instance methods) in the body of the function, similar to the ability of the object denoted by this to implicitly be the receiver of member access operations in instance methods.

The motivation for having this feature is that it allows developers to express a number of common programming tasks more concisely, using a mechanism which is very well-known from the treatment of this in instance methods.

An important source of inspiration for this mechanism is TODO: find references to Kotlin/Swift/Groovy.

Syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment