[swift-evolution] Proposal: Allow operators to have parameters with default values

Dave DeLong swift at davedelong.com
Fri Nov 3 12:47:57 CDT 2017

The call stack could certainly be a worthwhile thing to capture in an operator implementation. The #file and #line would tell you which usage of the operator you’re using, and the callStackSymbols would tell you how you got there. You’d want them both, however, if you used the same custom operator multiple times in the calling function: the callStackSymbols alone wouldn’t necessarily be enough to disambiguate which usage of the operator you should be looking at.


> On Nov 3, 2017, at 11:40 AM, Mike Kluev <mike.kluev at gmail.com> wrote:
> on Fri, 3 Nov 2017 09:40:35 -0600 Dave DeLong <swift at davedelong.com <mailto:swift at davedelong.com>> wrote:
> > That’s cool, but a hygienic macro system isn’t anywhere on the Swift roadmap.
> >
> > Chris has mentioned in interviews that such a system is "a big feature that’s open-ended and requires a huge design process” which makes off-the-table for Swift 5, and (I’m guessing) unlikely for Swift 6 too.
> > Personally I’d like to be able to better debug my apps in Swift 4.1 rather than waiting another 2 or 3 years for a magical macro system to somehow solve this.
> if that's just for debugging -- consider using Thread.callStackSymbols
> last i checked it has the entries in the mangled form, but probably it's (1) good enough for debugging purposes and (2) possible to de-mangle them somehow.
> Mike

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171103/5a0bc160/attachment.html>

More information about the swift-evolution mailing list