Skip to content

Name the ~= (pattern matching?) operator when introducing it #304

@swift-ci

Description

@swift-ci
Previous ID SR-896
Radar None
Original Reporter douglashill (JIRA User)
Type Improvement
Additional Detail from JIRA
Votes 1
Component/s Standard Library
Labels Improvement, Documentation
Assignee None
Priority Medium

md5: fccac19dc8668e07b859568b36ae3644

Issue Description:

Reading through the Swift book in iBooks, the ~= is mentioned but not named. There are numerous advantages to having a clear name:

  • We can vocalise internally while reading and writing code. Many of us need to think using language: it is how we structure our thoughts.
  • We can vocalise while speaking (rather than writing) to other people about Swift.
  • Provides guidance on expected behaviours when overloading the operator.
  • Names are easier to search for. Most search engines (including Google and Jira) seem to ignore ~=.

I am sorry if I am missing the name somewhere; it's hard to search for.

https://docs.swift.org/swift-book/documentation/the-swift-programming-language/patterns

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content issueA problem in with the book's prose, code, or figuresGood first issueWork that's well-suited for new contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions