[m-rev.] for review: mercury implementation of string.m

Ralph Becket rafe at cs.mu.OZ.AU
Mon Jun 17 12:58:10 AEST 2002


Simon Taylor, Saturday, 15 June 2002:
> On 14-Jun-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> > > > +string__to_int_list(String, IntList) :-
> > > > +	string__to_char_list(String, CharList),
> > > > +	IntList = list__map(char__to_int, CharList).
> > > 
> > > Why not just remove the foreign implementation altogether?
> > 
> > Well the foreign implementation should be faster then the Mercury
> > implementation if we are using the foreign_code version of
> > string__to_char_list.
> 
> Where is it used that needs the extra speed? The only place I can
> see is string__hash, which is very sub-optimal anyway. The historical
> reason for the foreign code verison was the lack of mode-specific
> clauses.

My first reaction was to ask why would the Mercury version incurr any
penalty at all, unless a given back-end makes it non-free to cross the
Mercury/foreign language interface?  However, I'm guessing that
deforestation is going to have a hard time with that code...

- 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