note
BrowserUk
<blockquote><i></i></blockquote>
<p>As I originally proposed it, I don't think it would. In any legal [printf] format, <c>%</c> is followed one of
<c>%*+- #csduoxefgXEGbpniDUOF\d.</c>.
<p>Which I think means that <c>%{...}</c> would not conflict with any existing formats, and would generate: <c>Invalid conversion in printf: "%{"</c> if it appeared in any existing code. The lack of backwards compatibility issues is the nice thing about that original proposal. Albeit that I'd extend/mutate my original proposal to encompass some of the further discussion it generated.
<p>It can easily be extended to make <c>%{...}</c> a generic, interpolate whatever is inside this embedded code block and convert the result to a string in the default manner.
<p>And that could further be extended in a manner in keeping with normal [printf] rules so that it can become:
<c>%fw.p{...}</c> where the <i>f</i>, <i>w</i> & <i>p</i> follow the same rules for flags, width & precision as are applied to the standard <c>s</c> specifier.
<p>To simplify: <c>%fw.p{xxx}</c> acts pretty much like:
<code>
printf "%fw.ps", "@{[xxx]}"
</code>
<p>The code <c>xxx</c> is evaluated, the result converted to as string, and the string substituted as if <c>%s</c> had been used.
<div class="pmsig"><div class="pmsig-171588">
<hr />
<font size=1 >
<div>Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.</div>
<div>"Science is about questioning the status quo. Questioning authority". </div>
<div>In the absence of evidence, opinion is indistinguishable from prejudice.</div>
<div>[http://news.bbc.co.uk/1/hi/education/6202877.stm|"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."]</div>
</font>
</div></div>
633641
702883