I get it that the point here is about the intention. If you mean to call that initialiser, using an extra name or none should make no difference. If there is a chance people are misusing the nameless initialiser, I don't see a reason why not adding a name here.<br><br>On Wednesday, 25 May 2016, Karl Wagner via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What is so bad about the global function idea?<br>
<br>
reflect(_:Any)->String<br>
<br>
It’s invoking the reflection APIs, doing a bunch of things you could do yourself with Mirror, and returning a String.<br>
<br>
I know we don’t have many global functions, but this seems like a reasonable place for one.<br>
<br>
This isn’t Objective-C; we have namespaces. You can still create another function with that same signature, and refer to the global one with Swift.reflect().<br>
<br>
Karl<br>
<br>
> On 22 May 2016, at 20:19, Dave Abrahams via swift-evolution <<a href="javascript:;" onclick="_e(event, 'cvml', 'swift-evolution@swift.org')">swift-evolution@swift.org</a>> wrote:<br>
><br>
><br>
> on Fri May 20 2016, Kevin Ballard <<a href="javascript:;" onclick="_e(event, 'cvml', 'swift-evolution@swift.org')">swift-evolution@swift.org</a>> wrote:<br>
><br>
>> On Fri, May 20, 2016, at 05:14 PM, Dave Abrahams via swift-evolution wrote:<br>
>>><br>
>>> on Fri May 20 2016, Kevin Ballard <<a href="javascript:;" onclick="_e(event, 'cvml', 'swift-evolution@swift.org')">swift-evolution@swift.org</a>> wrote:<br>
>>><br>
>>>> On Tue, May 17, 2016, at 08:32 PM, Chris Lattner via swift-evolution wrote:<br>
>>>>> * What is your evaluation of the proposal?<br>
>><br>
>>>><br>
>>>> I'm a little nervous about this change, because converting things to<br>
>>>> strings is a fairly basic operation and it should be immediately<br>
>>>> obvious how to do that. That said, the described issues are pretty<br>
>>>> bad, and I know I've had to carefully triple-check sometimes to make<br>
>>>> sure I was calling the right initializer. So I'm +1 on the idea.<br>
>>>><br>
>>>> That said, I don't like the name String(printing:). As others have<br>
>>>> pointed out, it sounds like this is related to print(), but this<br>
>>>> initializer does not actually print anything, it just converts any<br>
>>>> value into a string. I also don't like String(describing:) because<br>
>>>> it's too long. This initializer should be easier to call than<br>
>>>> String(reflecting:). Also, in my experience this initializer is<br>
>>>> particularly useful with code of the form `someOpt.map(String.init)`,<br>
>>>> and saying `someOpt.map(String.init(describing:))` is annoyingly long.<br>
>>>><br>
>>>> Given this, I'd like to suggest the simpler `String(from:)`. It's<br>
>>>> short and generic, and it makes sense as it creates a String from any<br>
>>>> value.<br>
>>><br>
>>> Not too bad. I could live with it.<br>
>><br>
>> 😀<br>
>><br>
>>>> I'm also not a fan of Dave's suggestion of removing this initializer<br>
>>>> entirely in favor of "\(foo)". This feels weird, and it also can't be<br>
>>>> turned into a first-class function value.<br>
>>><br>
>>> { "\($0)" }<br>
>>><br>
>>> ?<br>
>><br>
>> Good point. I think what I intended to express was you cannot refer to<br>
>> this operation by name anymore. Maybe not a big deal, but it feels<br>
>> weird.<br>
><br>
> Makes sense.<br>
><br>
> --<br>
> -Dave<br>
><br>
> _______________________________________________<br>
> swift-evolution mailing list<br>
> <a href="javascript:;" onclick="_e(event, 'cvml', 'swift-evolution@swift.org')">swift-evolution@swift.org</a><br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'swift-evolution@swift.org')">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote><br><br>-- <br><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><img src="https://docs.google.com/uc?export=download&id=0BynK4d4SfQPuNnFzckZaLWxYejA&revid=0BynK4d4SfQPuWmcwZENNT0UyVWE2bEJETm9HZ05zMGdadHRzPQ"><br></div></div></div></div></div><br>