[swift-evolution] [Pitch][Swift 5?] #dup "macro", i.e. Entity Duplication

Daryle Walker darylew at mac.com
Tue Aug 8 13:35:30 CDT 2017


I posted a revision (2) of the entity duplication <https://gist.github.com/CTMacUser/44afa75e379ec70201391af3a39bcdeb>. I added the ability to use the index placeholder as a closure anonymous argument, i.e. parameterize “$0,” “$1,” etc. with “$($$0).” I thought a direct triple-dollar-sign would be confusing, from determining which order the “$” and “$$” bind (or if it’s yet another new token).

I don’t think anyone has looked at this yet. I do want it for Swift 5, if possible. It’s the dual to variadic parameters/arguments; for producing comma-separated lists (instead of consuming), but can be used for non-variadic stuff too.  “constexpr” would help, but it’s not necessary. It would complement variadic generics, if added.

I want to know if the grammar scheme (the one in the “Grammar” section, not the troll version a few paragraphs before) is the good approach. And if the idea is even feasible to implement.

— 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170808/2483f3dd/attachment.html>


More information about the swift-evolution mailing list