[m-dev.] For review: added string__words/2

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Apr 16 01:30:09 AEST 2000


On 14-Apr-2000, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> On Fri, Apr 14, 2000 at 02:32:31AM -0700, Ralph Becket wrote:
> > > > +words_0(SepP, String, WordEnd, Words0) = Words
> > > > +:-
> > > > +    ( if WordEnd < 0 then
> > > > +        Words = Words0
> > > > +      else
> > > 
> > > Normally we indent the `;' for an if-then-else at the same 
> > > level as the
> > > `('.  The Mercury coding guidelines don't explicitly discuss layout
> > > for the `(if ... then ... else ...)' form, but IMHO it should 
> > > match the layout for the `(... -> ... ; ...)' form.  (Any other 
> > > opinions on this?)
> > 
> > I prefer my layout, to be honest.  I tried mimicking the `-> ;'
> > layout style, but it just looks ugly IMHO.  Given that I seem to be
> > the only person using long-hand, I would like a weighted vote on this
> > issue :)
> 
> I agree with Ralph.  I see no reason to make the code a line longer.  Where
> there's an `if', you know a `then' is coming, so why draw attention to it?

I think you must have misunderstood.  I was not suggesting that the code
should be made any longer.  I was suggesting that it be formatted corresponding
to the way we format `(Cond -> Then ; Else)' if-then-elses, i.e. as

	(if Cond then
		Then
	else
		Else
	)

whereas Ralph prefers

	( if Cond then
		Then
	  else
		Else
	)

The only difference is that Ralph's preferred layout has three extra
spaces - one after the `(' and two before the `else'.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list