[m-dev.] For review: minor additions to list.m and string.m

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Sep 8 16:14:17 AEDT 2000


On 08-Sep-2000, schachte at cs.mu.OZ.AU <schachte at cs.mu.OZ.AU> wrote:
> On  7 Sep, Ralph Becket wrote:
> > Estimated hours taken: 0.25
> > 
> > Small additions to list and string.
> 
> This looks good; I just have one comment:
> 
> > library/list.m:
> > 	Added func ++/2 as a synonym for list__append/2.
> > 	Added func '..'/1 to generate ascending/descending integer range
> > lists.
> 
> Firstly, s/1/2/.
> 
> I'm not sure this is the best way to do descending sequences. This means
> you can never generate an empty list.  Eg, I would find
> 
> 	1..0 = []
> 
> more natural than
> 
> 	1..0 = [1,0]

I agree.  Also the behaviour of `..' is inconsistent with Haskell,
for which `[1..0]' evaluates to `[]'.  In Haskell, you need to write
`[1,0..0]' to get `[1,0].

Ralph, the `++' methods look fine; unless there are any other objections,
I suggest you go ahead and commit those.

For `..', I suggest you change the semantics to match those in Haskell.

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