Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 1.44 KB

0097-negative-attributes.md

File metadata and controls

34 lines (21 loc) · 1.44 KB

Normalizing naming for "negative" attributes

Introduction

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

Swift-evolution thread: RFC: didset and willset

Motivation

Swift is an opinionated language. One opinion it adheres to is that attributes should be built around "non", and not "no", avoiding camel casing bumps. Converting no-prefixed attributes to non-integrated attributes establishes a single word that describes how each attribute modifies 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 with limited impact on existing 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".