[m-rev.] For revew: a new, improved pretty printer

Ian MacLarty maclarty at csse.unimelb.edu.au
Thu Aug 2 09:39:43 AEST 2007


On Wed, Aug 01, 2007 at 06:35:13PM +1000, Mark Brown wrote:
> On 01-Aug-2007, Ralph Becket <rafe at csse.unimelb.edu.au> wrote:
> > Zoltan Somogyi, Wednesday,  1 August 2007:
> > > On 01-Aug-2007, Ralph Becket <rafe at csse.unimelb.edu.au> wrote:
> > > > +:- type doc
> > > > +    --->    s(string)                   % Output a literal string.  Strings
> > > > +                                        %   containing newlines, hard
> > > > +                                        %   tabs, etc. will lead to strange
> > > > +                                        %   output.
> > > > +    ;       nl                          % Output a newline if the enclosing
> > > > +                                        %   group does not fit on the current
> > > > +                                        %   line.
> > > 
> > > I think the documentation would be much easier to read (and to write)
> > > in this style:
> > > 
> > >        ;        nl
> > >        		% Output a newline if the enclosing group does not fit
> > > 		% on the current line.
> > 
> > Hmm, in this case I prefer the style I've used.  Anybody want to cast a
> > tie-breaking vote?
> 
> Zoltan convinced me a while ago that the style he advocates here is the best.
> It makes better use of screen real estate, and it keeps the start of the
> comment close to the start of the thing it is commenting on so the two are
> more obviously connected.
> 

We should probably add this to our Mercury coding standards document (as
the way Ralph is doing it is the style suggested by the coding standards).

Out of curiosity, what's the reason for putting the comment after the
functor and not before?  In all other situations we put the comment
*before* the thing the comment is about.

Ian.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list