Wanted: Routine to convert table to string

Issue #601 closed
Erik Schnetter created an issue

It would be nice to have a routine that converted a table to a string, using the same syntax that is accepted by Util_TableCreateFromString. This is a nice, compact notation that is much easier to read than the internal table dumping syntax.

Keyword:

Comments (7)

  1. Ian Hinder
    • removed comment

    (The attached patch does not convert the table to a string and return it - as far as I can tell it prints a nicer-formatted version to a FILE stream.)

    Perhaps the names of the new functions, Util_TablePrint and Util_TablePrintString, could be changed to reflect that the only difference between them is that the latter prints in a friendlier, more-compact format (assuming I understood the patch correctly).

    These functions also need to be documented in the reference manual.

  2. Erik Schnetter reporter
    • removed comment

    I suggest to rename Util_TablePrintString to Util_TablePrintPretty, keep the remainder of the patch as is, and add documentation. I take the lack of comments on other issues as acceptance.

    Do you really need to see a new patch?

  3. Ian Hinder
    • removed comment

    I don't need to see a new patch. Your suggestions sound good, and I would be happy for them to be committed as you described them. We commit to a Cactus API like this at the next release, I suppose.

  4. Log in to comment