[m-rev.] for review: dump terms as docs in mdb

Zoltan Somogyi zoltan.somogyi at runbox.com
Thu Aug 25 11:24:14 AEST 2022


2022-08-25 11:13 GMT+10:00 "Peter Wang" <novalazy at gmail.com>:
>> Allow terms to be dumped as docs in mdb.
>> 
> 
> I'm confused by this, as "docs" is not a data format. This functionality
> should just be called pretty printing, and the dump command should take
> a -p argument.

I have no objection to renaming the option, but among "dump", "dump -x"
and "dump -d/p", the outlier is "dump -x", not "dump -d/p". -x writes out
XML; the others both write out terms in Mercury syntax, though without
any escapes of special chars, because that would hurt more than it would help.

>> +* The `dump` command has a new option: `dump -d Var` will dump the value
>> +  of the given variable using the `write_as_doc` predicate in the
>> +  pretty_printer module of the standard library.
>> +
> 
> Say dump now supports pretty printing, without mentioning the
> implementation method.

How about "... given variable in a pretty-printed form"?
 
> Don't mention the implementation method.

I will repeat the above wording.

>> +            if (xml && doc) {
>> +                fflush(MR_mdb_out);
>> +                fprintf(MR_mdb_err,
>> +                    "mdb: the -d and -q options of the \"dump\" command "
>> +                    "are mutually exclusive; ignoring -d.\n");
>> +            }
> 
> -q should be -x

Good catch. Thanks for the review.

Zoltan.


More information about the reviews mailing list