SourceForge has been redesigned. Learn more.
Close

#4517 Overeager String conversion in [format %s]

obsolete: 8.6b1
closed-fixed
5
2010-01-18
2010-01-14
No

As described in

http://groups.google.com/group/comp.lang.tcl/tree/browse_frm/thread/1eb1932e16e25422/5cc54e913d84ec4b?rnum=1&_done=%2Fgroup%2Fcomp.lang.tcl%2Fbrowse_frm%2Fthread%2F1eb1932e16e25422%2Fb2ca7ba01ad9bef4%3F#doc_5cc54e913d84ec4b

[format %s] converts its object argument to tclStringType, due to generic handling of optional with specifiers.
This is unnecessary, concatenation and char counting can very well be done at the string rep level (modified UTF-8), thus avoiding many cases of undue shimmering.

Note that [append] does the same, but the shimmering is unavoidable, since the result's internal repr is invalidated by appending.

Discussion

  • Alexandre Ferrieux

    fixes String shimmering of inputs

     
  • Alexandre Ferrieux

    The attached patch fixes the unwanted force-to-String of inputs, which was due to char counting done even when not needed.

    Note that the *output* of [format %s] is still a String object, but that's another story.

     
  • Alexandre Ferrieux

    • status: open --> open-fixed
     
  • Alexandre Ferrieux

    • labels: 104239 --> 44. UTF-8 Strings
    • assigned_to: msofer --> dkf
     
  • Donal K. Fellows

    • assigned_to: dkf --> msofer
     
  • Donal K. Fellows

    Applied to HEAD.

     
  • Donal K. Fellows

    • assigned_to: msofer --> dkf
    • status: open-fixed --> closed-fixed
     
  • Donal K. Fellows

    and to 8.5 (no test there)