[swift-evolution] Proposal: Unicode visualization annotations in declarations.

Sune Foldager cyano at me.com
Mon Jan 18 11:27:04 CST 2016


What do we gain by this? Swift is a modern language with unicode source file support. If you use those, it may sometimes mean it’s difficult to edit programs on a more limited system, but

a) You don’t have to use those symbols in your own code.
b) Is that concern really worth adding extra syntax for, like this?

I don’t think so myself.

-Sune

> On 16 Jan 2016, at 20:51, Amir Michail via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Example source:
> 
> let alpha/𝛼 = 5
> print(“alpha=\(alpha)”)
> 
> An IDE/editor that understands these visualization annotations would show this source as:
> 
> let alpha/𝛼 = 5
> print(“alpha=\(𝛼)”)
> 
> Moving the cursor over 𝛼 would tell you in the status bar that this is a visualization for “alpha”.
> 
> Note that in the source, the unicode character only appears in the visualization annotation. 
> 
> Here’s another example:
> 
> enum Suit { case Heart/♡, Diamond/♢, Spade/♠︎, Club/♣︎ }
> let x = Suit.Heart
> 
> In an IDE/editor that supports visualization annotations, the following would be shown:
> 
> enum Suit { case Heart/♡, Diamond/♢, Spade/♠︎, Club/♣︎ }
> let x = Suit.♡
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160118/8092d041/attachment.html>


More information about the swift-evolution mailing list