[m-rev.] diff: implement concat_string_list for .NET

Ralph Becket rafe at cs.mu.OZ.AU
Fri Feb 21 17:49:49 AEDT 2003


Fergus Henderson, Friday, 21 February 2003:
> Even though this patch doesn't completely solve the problem,
> I think it is a step on the way, so unless anyone has any
> objections, I will go ahead and commit this.
> 
> On 18-Feb-2003, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> [...]
> >  string__unsafe_index(Str, Index, Char) :-
> > -	( string__index(Str, Index, IndexChar) ->
> > -		Char = IndexChar
> > +	( string__first_char(Str, First, Rest) ->
> > +		( Index = 0 ->
> > +			Char = First
> > +		;
> > +			string__unsafe_index(Rest, Index - 1, Char)
> > +		)
> >  	;
> >  		error("string__unsafe_index: out of bounds")
> >  	).

Just as a point of style,

			Char = Rest ^ unsafe_elem(Index - 1)

might be better than

> > +			string__unsafe_index(Rest, Index - 1, Char)

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