[m-rev.] for review: atoms in the debugger

Ralph Becket rafe at cs.mu.OZ.AU
Wed Jan 2 15:37:01 AEDT 2002


Zoltan Somogyi, Wednesday,  2 January 2002:
> On 02-Jan-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> > > +:- func synthetic_term_to_doc(string, list(univ), bool)           = doc.
> > > +:- func synthetic_term_to_doc(int, string, list(univ), bool)      = doc.
> > 
> > Is this function of sufficiently general utility to make it part of the
> > interface to pprint?  Maybe it would be better off in a util module
> > specific to the term browser?
> 
> That's what I initially tried to do. However, doing that would require
> exporting the currently private function packed_cs_univ_args (and probably
> packed_cs_to_depth, of which it is a version) from pprint.m. Is that OK
> with you?

Ah, good point.  Looking at the code for packed_cs_to_depth/2 I see it's
just

packed_cs_univ_args(Depth, UnivArgs) =
    packed_cs(
        Depth,
        list__map(func(UnivArg) = to_doc(Depth, univ_value(UnivArg)), UnivArgs)
    ).

You could use the same idiom in synthetic_term_to_doc/3 in a util
module.

But since this crops up both in synthetic_term_to_doc/3 and locally in
pprint, I think there is a case for exporting packed_cs_to_depth/2 and
packed_cs_univ_args/2 from pprint.  Perhaps that's the best thing to do.

- Ralph
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list