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

Ralph Becket rbeck at microsoft.com
Fri Apr 14 19:32:31 AEST 2000


> From: Fergus Henderson [mailto:fjh at cs.mu.OZ.AU]
>
> > $ cvs commit -F RALPHS_CHANGES_20000406 {array,std_util,string}.m
> > Did I do something wrong?
> 
> Well, your commit certainly didn't get through.
> I'm not sure why not.

Odd.  I'll have another go.
 
> To avoid line wrapping in the printed manual,
> please keep the comments in the interface to
> less than about 60 characters in width.

Righto.

> For consistency with the other procedures in this
> module, I suggest s/words/string__words/g here.

Okay.

> > +words(SepP, String) = words_0(SepP, String, I, [])
> > +:-
> > +    I = preceding_boundary(isnt(SepP), String, 
> string__length(String) - 1).
> 
> To conform with the Mercury coding guidelines, s/_0/_2/g.
> Also the `:-' should not be on a new line.

Not a problem.  `_0' is just my habit.
I've been toying with putting `:-' on a separate line for
functions since it's more obvious there, although perhaps
it should be indented so as not to be confused with a
compiler directive or declaration.  But I'll append it to
the head for the sake of consistency.

> > +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 :)

> Also please use 8-character indentation, to match that in the rest of
> this module.  I'm happy for new modules to use 4-character 
> indentation,
> but it gets difficult if a single module contains a mix of 4- and
> 8-character indentation.

No problem.

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