On 11/14/2012 08:12 PM, Lawrence Crowl wrote:
Diego and I seek your comments on the following (loose) proposal.


We propose to provide several function overload sets, as below.


dump_pretty

     This function overload set provides the bulk of the printing.
     They will use the existing pretty-printer functions in their
     implementation.
Since this is the one that would be most commonly used, could we just call it "dump"?
dump_raw

     This function overload set provides the raw oriented dump,
     e.g. a tuple.

dump_verbose

     This function overload set provides the extra details dump.



All of these functions come in two forms.

     function (FILE *, item_to_dump, formatting)
     function (item_to_dump, formatting)

If the FILE* is not specified, the output is to stderr.  The
formatting argument is optional, with a default suitable to the kind
of item to dump.

assuming there aren't any varargs, why not simply move the 'FILE *' parameter to the end, default it to STDERR, and then only have the one function... I'm certainly not locked into the old style must-have-FILE first paradigm.

Although I guess then you have the issue of default formatting when you don't have a default FILE... Which I guess is probably more important. OK , 2 functions is probably better since one is just a wrapper anyway :-)

Overall I like this as well. Again, with my lousy memory for exact function names, I'm always grepping through the different print files to find the routine I'm looking for. Standardizing them in name and format would be helpful.

Andrew

Reply via email to