> On Oct 18, 2016, at 09:39 , Nevin Brackett-Rozinsky via swift-evolution 
> <[email protected]> wrote:
> 
> It seems natural to me that currency symbols should be operators. This would 
> allow, for example, prefix and postfix operators that take a number and 
> return a “Currency” instance:
> 
> let inMyPocket = $20
> let lochNess = £3.50
> let twoBits = 25¢
> 
> if (inMyPocket - lochNess) > twoBits { … }
> 
> Of course, the unnamed closure parameter identifiers would conflict with that 
> use of the dollar sign. However, I think Anton has the right idea. We already 
> use the number sign for compiler magic, so it would make sense to call the 
> closure parameters #0, #1, etc. In my view those even read better than what 
> we have now.

Except of course, '#' means "pound" is some contexts, and you might want to 
make a # operator return a weight.

I'm okay with giving up '#' for this, however.


-- 
Rick Mann
[email protected]


_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to