Skip to content

Instantly share code, notes, and snippets.

@erica
Last active April 2, 2018 16:58
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erica/f1faa260814395035edb0e481e1ad701 to your computer and use it in GitHub Desktop.
Save erica/f1faa260814395035edb0e481e1ad701 to your computer and use it in GitHub Desktop.

Introducing a 🐶🐮 (Syntax.DogCow) Literal

  • Proposal: SE-M00F
  • Author: Erica Sadun
  • Status: Draft
  • Review manager: Crusty

Introduction

When not bound as a symbol, this proposal allows the "dogcow" literal to be used in place of otherwise unspecified values. Swift infers a value to substitute, automatically introducing the most appropriate value at any use point.

Motivation

The dog cow offers historic symbology for any Apple product. By introducing the dog cow as a literal platonic ideal, it ties Swift into the rich culture of the Apple ecosystem.

Detailed Design

Under this proposal, 🐶🐮 adopts the best possible value specific to its use. In strings, it is "moof", as a number 42, as a Bezier path, it describes the rounded rect, as a set, all Stooges -- including Swift.Shemp, and as a tree structure must express several missing branches, its curvature be matched to the golden mean, and the initials of a pair of lovers be carved into its data.

In keeping with the rule of Lattner (specifically that any proposal that breaks let 🐶🐮 = "moof" will not be tolerated.), 🐶🐮 can be bound as a symbol, in which case, identical behavior is imparted through Syntax.DogCow, offering alternative namespaced access to the ideal literal.

Impact on Existing Code

This proposal is purely additive.

Alternatives Considered

Not at this time.

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