[swift-evolution] superscripts, subscripts, etc.

Nevin Brackett-Rozinsky nevin.brackettrozinsky at gmail.com
Thu Oct 5 09:23:02 CDT 2017


On Tue, Oct 3, 2017 at 2:02 AM, Chris Lattner via swift-evolution <
swift-evolution at swift.org> wrote:

> You want:
>
> x²  to parse as “superscript2(x)” - not as an identifier “xsuperscript2”
> which is distinct from x.
>
> -Chris


I am of two minds on this. Sometimes I want x² to parse as x*x (an
operator) but other times I want to store the value of x*x in an identifier
spelled… x². This could be simply to avoid repeatedly performing the same
calculation, or it could be the natural result as in,

let r² = someStatisticsThing(xVals, yVals)

Not sure where I’m going with this, just wanted to mention it.

Nevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171005/c33bf549/attachment.html>


More information about the swift-evolution mailing list