[Development] Introducing discussion about QStringFormatter

Thiago Macieira thiago.macieira at intel.com
Tue May 16 19:14:26 CEST 2017


On terça-feira, 16 de maio de 2017 06:50:18 PDT Jason H wrote:
> I also wonder about the SQL bound parameter interface? That formatting is a
> mash of :? or :name or something else (":1"?). I think for consistency,
> that should be able to use whatever the rest of the toolkit does too.

Choose one only. I don't think the :1 syntax offers any advantage over %1, so 
it's out of consideration: it's only as good as what we already have.

I'd prefer we kept the % syntax which we already have, but from the 
discussion, it looks like it won't work. We need a syntax that has a clear 
open and close so that more options can be placed inside the placeholder.

On {}{}: I think that's an acceptable shorthand, just like we have "%1 is %1" 
today. A bracket without any digits has higher replacement precedence than 
{0}:

  "The {0} brown {} jumped over the {2} {3}" % ("fox", "quick", "dog", "lazy")

{} gets replaced ahead of {0}, then {0}, then {2} because {1} is missing, then 
{3}.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list