On Tuesday, 24 April 2012 at 04:55:34 UTC, kenji hara wrote:
My concern is that the proposal is much complicated and less useful
for general use cases.
You can emulate such formatting like follows:

IMHO addition of %!+s and %!-s alone and removing %c's magic will only simplify formatting for the user. It was hard (for me) to understand current escaping rules because it's undocumented and looks dissonant (for me) because of the fact that escaping is a part of formatting but user is unable to control it unless magical %c is used.

I agree that !', !", and !?* of course aren't commonly used as I have already written. Personally I don't need them at all.

But this is a common pattern for me: `xformat("My pets: %(%!-s, %)", petsAsStrings)`. And "My pets: %(%(%c%), %)" is too complicated, dissonant and not general (will not work if I'll give it pets as int[] e.g.) that I never use it. I use `.joiner(", ")` instead and every time I do it I think that something is really wrong with array formatting in Phobos.

--
Денис В. Шеломовский
Denis V. Shelomovskij

Reply via email to