Skip to content

Instantly share code, notes, and snippets.

@erica
Last active May 20, 2016 23:08
Show Gist options
  • Save erica/f31d580d7dcca3c416181a2973a185d5 to your computer and use it in GitHub Desktop.
Save erica/f31d580d7dcca3c416181a2973a185d5 to your computer and use it in GitHub Desktop.

Normalizing naming for "negative" attributes

  • Proposal: TBD
  • Author: Erica Sadun
  • Status: TBD
  • Review manager: TBD

Introduction

This proposal normalizes naming for "negative" attributes by adopting a rule that replaces camel-cased property names starting with no with adjectives starting with non.

Swift-evolution thread: RFC: didset and willset

Motivation

Converting no-prefixed attributes to non changes them into a single word that describes how they modify the syntax they decorate.

Detailed Design

Upon adoption, Swift will rename:

  • noreturn to nonreturning
  • noescape to nonescaping

Impact on Existing Code

This proposal requires migration support to rename keywords that use the old convention to adopt the new convention. This is a simple substitution that should limit effect on code.

Alternatives Considered

The core team may consider exceptions for terms of art. For example, "no return" indicates "there is no return from this function", as in the "point of no return".

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