On 11/20/12, Andrew MacLeod <amacl...@redhat.com> wrote:
> 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"?

We will almost certainly want to name one of them just dump.
We chose to be verbose in this discussion so that we have a clearer
idea of what we intend for each.

>> 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 :-)

Yes, when you want to default two different things equally, it makes
sense to do the overload.  (The current proposal assumes that one
does not need to dump a FILE.)

-- 
Lawrence Crowl

Reply via email to