So '"%...x",str' would be equivalent to '"%@...x",values(str)' for any value of '...' I take it? I.e. you would use 'sprintf("%02x", "Hej")' as a shorthand for 'sprintf("%@02x", values("Hej"))'?
And sprintf("%@02x", ({"Hej","Svej"})) as a shorthand for sprintf("%@@02x", ({values("Hej"),values("Svej")}));
So '"%...x",str' would be equivalent to '"%@...x",values(str)' for any value of '...' I take it? I.e. you would use 'sprintf("%02x", "Hej")' as a shorthand for 'sprintf("%@02x", values("Hej"))'?
That's what I assume, though I'd prefer
sprintf("%...x", Gmp.bignum(str, 256))
as equivalent in the first case (consider eg sprintf("%-016x", str)). The '-' flag should probably indicate reverse network byte order (analogous to eg %c and %F). Then there's of course the problem of what the format should do if str is wide?
Well, that won't work for widestrings. I would expect e.g. sprintf("%5x", "\u2018!\u2019") to yield " 2018 21 2019".
pike-devel@lists.lysator.liu.se