[m-rev.] Minor addition to string.m

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jan 29 20:45:26 AEDT 2003


On 29-Jan-2003, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Simon Taylor, Wednesday, 29 January 2003:
> > On 29-Jan-2003, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> > > Estimated hours taken: 0.5
> > > Branches: main
> > > 
> > > library/string.m:
> > > 	Added function chomp/1.
> > 
> > How about `remove_trailing_newline', or even better a more
> > general `remove_trailing_char'.
> 
> remove_trailing_char is a good idea; I'll add that.
> 
> chomp is pretty well known (it's a Perlism...).  How about if I add
> remove_trailing_newline as a synonym for chomp?  That should cover
> all the bases.

Ugh.  One name only, please.  There's already more than enough
unnecessary duplication in the Mercury standard library.

If another name is used, it should use `nl' not `newline',
since we already have `io.nl'.  Perhaps `strip_trailing_nl'?

I would be happy with the name `chomp', though.  Although it is definitely
gobbledigook to the uninitiated, it is actually quite mnemonic -- once
you've head of it once, you don't forget it (or at least it is that way
for me).

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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