[swift-evolution] Pitch: Renaming CharacterSet to UnicodeScalarSet

Xiaodi Wu xiaodi.wu at gmail.com
Wed Sep 28 19:01:30 CDT 2016


Afaik, every Unicode scalar can be its own character, so IMO it's not
bothersome that there are overloads that take Unicode scalar arguments.
However, since the stated purpose of the type is to be a set of characters,
isn't the problem you're presenting really an argument that the type should
be fleshed out to handle characters (grapheme clusters) containing more
than one Unicode scalar?


On Wed, Sep 28, 2016 at 18:43 Erica Sadun <erica at ericasadun.com> wrote:

> On Sep 28, 2016, at 3:58 PM, Xiaodi Wu <xiaodi.wu at gmail.com> wrote:
>
>
> Is this really correct? Character and UnicodeScalar are not synonyms. The
> Character type represents a character made up of one or more Unicode
> scalars (i.e. an extended grapheme cluster). Is a CharacterSet a set of
> Unicode-compliant characters that happens to be restricted to those
> characters each made up of only a single Unicode scalar, or is it meant to
> be a set of Unicode scalars? My read of the Foundation documentation is
> that it is the former.
>
>
> http://i.imgur.com/h6W5kYc.jpg
>
> http://i.imgur.com/q50PSld.jpg
>
> -- E
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160929/ed70030d/attachment.html>


More information about the swift-evolution mailing list