[m-rev.] for review: change list constructor from `./2' to `[|]/2'

Mark Brown dougl at cs.mu.OZ.AU
Tue Sep 25 01:04:37 AEST 2001


On 24-Sep-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> On 24-Sep-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > On 23-Sep-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > > Index: tests/debugger/declarative/app.exp
> > > ===================================================================
> > > RCS file: /home/mercury1/repository/tests/debugger/declarative/app.exp,v
> > > retrieving revision 1.10
> > > diff -u -u -r1.10 app.exp
> > > --- tests/debugger/declarative/app.exp	2000/10/01 03:13:42	1.10
> > > +++ tests/debugger/declarative/app.exp	2001/09/23 07:34:37
> > > @@ -15,7 +15,10 @@
> > >  mdb> finish -n
> > >        16:      5  5 EXIT pred app:app/3-0 (det) app.m:26 (app.m:28)
> > >  mdb> dd
> > > -app([4, 5], [6, 7, 8], [4, 5, 6, 7, 8])
> > > +pred app
> > > +	[4, 5]
> > > +	[6, 7, 8]
> > > +	[4, 5, 6, 7, 8]
> > 
> > That change appears to be unrelated.
> 
> It's not. `browser/declarative_user__check_decl_atom_size' uses
> a fairly crude heuristic to determine whether an atom will fit
> on a line. Now that the list constructor is three characters long
> rather than one, there are a few places in the tests which,
> according to the heuristic, will no longer fit on one line.
> I'm not sure whether it's worth special casing `[|]' in the
> heuristic. I'll leave it as it is for now. Mark can decide
> what he wants to do with it.
> 

Leaving it as it is will be fine.  Thanks for looking into it, Simon.

The purpose of the heuristic is to catch the cases where the atom is so
small that printing one argument per line would look silly.  The main
requirement is that we don't underestimate the size; other than that the
accuracy is not that important.  The heuristic is still accurate enough,
I think.

Of course, it would be better to let the term browser decide where to
place the line breaks (using the pretty printer, for example), and this
is what I plan to do --- the heuristic currently used is merely a temporary
measure.  But this will require fairly significant changes to the term
browser, because it is currently only capable of browsing Mercury terms
and the atoms are not themselves Mercury terms, so this plan is unlikely
to be implemented in the near future.

Cheers,
Mark.

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