<div dir="ltr">Just a friendly ping that I'm looking to get this in tomorrow if there are no further blockers.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 8, 2016 at 3:29 PM Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Will leave this up until this Friday before committing unless there are further blockers.</div><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Tue, Nov 8, 2016 at 11:27 AM Zachary Turner <<a href="mailto:zturner@google.com" class="gmail_msg" target="_blank">zturner@google.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">This is now done in the latest diff.  Thanks for the suggestion.</div><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Mon, Nov 7, 2016 at 10:45 PM Chris Lattner <<a href="mailto:clattner@apple.com" class="gmail_msg" target="_blank">clattner@apple.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Nov 7, 2016, at 2:58 PM, Zachary Turner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_3636099809628955071m_-748952222723373792m_5740453702979058642Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg">FWIW, if you're only ever formatting numbers and strings (which I agree is likely a majority of use cases), the syntax should be very easy to remember.  Most of the time you don't need to specify anything other than the placeholder index.  In that respect I expect it to catch on very quickly as there's really nothing to remember.  <div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Only if you want to customize the behavior will you maybe have to look up the syntax, and in that case you would have to do something equally funky with printf (such as not using it and writing 4 lines of streaming stuff to an ostream instead).</div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">I haven’t looked at your most recent patch to see if you have already done this, but it would be great to add a section about this new API to "Important and useful LLVM APIs” in <a href="http://llvm.org/docs/ProgrammersManual.html" class="gmail_msg" target="_blank">http://llvm.org/docs/ProgrammersManual.html</a>.</div></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">-Chris</div><br class="gmail_msg"></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Mon, Nov 7, 2016 at 2:47 PM Justin Bogner <<a href="mailto:mail@justinbogner.com" class="gmail_msg" target="_blank">mail@justinbogner.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">James Y Knight via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a>> writes:<br class="gmail_msg">
>> You might be able to hook up a template-specialization like mechanic to the<br class="gmail_msg">
>> processing of %s (similar to my current approach), but it's not obvious how<br class="gmail_msg">
>> you proceed from there to get custom format strings for individual types.<br class="gmail_msg">
>> For example, a formatter which can print a TimeSpan in different units<br class="gmail_msg">
>> depending on style options you pass in.  This is especially useful when<br class="gmail_msg">
>> trying to print ranges where you often want to be able to specify a<br class="gmail_msg">
>> different separator, or control the formatting of the underlying type.<br class="gmail_msg">
>>  (e.g. it's not clear how you would elegantly format a range of integers in<br class="gmail_msg">
>> hex using this style of approach).<br class="gmail_msg">
>><br class="gmail_msg">
><br class="gmail_msg">
> It is entirely unclear to me that putting everything in a format string:<br class="gmail_msg">
>   formatv("Here's a range: {0:$[ + ]@[x]}", range);<br class="gmail_msg">
> is better than composing functions with usual function-call syntax, e.g.<br class="gmail_msg">
> something like this:<br class="gmail_msg">
>   format("Here's a range: %s", Join(range, " + ", Formatter("%x")));<br class="gmail_msg">
><br class="gmail_msg">
> I think that's the meat of the disagreement: I'd prefer to just see a safe<br class="gmail_msg">
> printf-replacement; something that's able to basically drop-in replace C<br class="gmail_msg">
> printf, nothing super fancy. I don't see the justification for being able<br class="gmail_msg">
> to specify everything you'd ever want to be able to do directly in a<br class="gmail_msg">
> complex format string language.<br class="gmail_msg">
><br class="gmail_msg">
> On the other hand, you see value in being able to specify the entirety of<br class="gmail_msg">
> the output in the format string, and aren't concerned about the syntax<br class="gmail_msg">
> being new and complicated.<br class="gmail_msg">
><br class="gmail_msg">
> That said -- it doesn't appear that my point of view is widely held, and<br class="gmail_msg">
> that's fine -- this is a matter of opinion, not right or wrong. So,<br class="gmail_msg">
> continue on. :)<br class="gmail_msg">
<br class="gmail_msg">
FWIW, I'm also not entirely sold that we need a complex formatting<br class="gmail_msg">
language here. The printf modifiers are easy to remember and are good<br class="gmail_msg">
enough 90% of the time, whereas with something like this I feel like I'd<br class="gmail_msg">
need to look up the syntax every time I used it.<br class="gmail_msg">
<br class="gmail_msg">
Like James though, I'm fine with conceding to the majority on this one.<br class="gmail_msg">
</blockquote></div></div></blockquote></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">
_______________________________________________</div></blockquote></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg">LLVM Developers mailing list<br class="gmail_msg"><a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg"><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg"></div></blockquote></div></div></blockquote></div></blockquote></div></blockquote></div>