[m-dev.] for review: string__fmt

Simon Taylor stayl at cs.mu.OZ.AU
Wed Aug 9 12:37:44 AEST 2000


Peter Ross wrote:
> On Tue, Aug 08, 2000 at 05:26:59PM +1000, Fergus Henderson wrote:
> > > +	% Implementation of append_list that uses C as this minimises the
> > > +	% amount of garbage created.
> > > +:- func fast_append_list(list(string)) = string.
> > > +:- pragma c_code(fast_append_list(Strs::in) = (Str::out),
> > 
> > Why have two seperate procedures `string__append_list' and
> > `string__fast_append_list'?  Why not just make the ordinary
> > `string__append_list' fast?
> > 
> Because string__append_list has two modes and I didn't want to implement
> the second mode in C.  Any suggestions on how to avoid this problem?

I'd suggest removing the second mode. It generates an infinite number
of solutions for any input string, so any code which uses it is probably
wrong. list__condense performs the same function for lists, and it does
not have an `(out, in)' mode.

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