[m-rev.] for review: Add string.append_string_pieces.

Peter Wang novalazy at gmail.com
Wed Nov 6 17:27:10 AEDT 2019


On Thu, 31 Oct 2019 18:51:17 +1100, Mark Brown <mark at mercurylang.org> wrote:
> >
> >
> > +%---------------------------------------------------------------------------%
> > +%
> > +% Making strings from smaller pieces.
> > +%
> > +
> > +:- type string_piece
> > +    --->    string(string)
> > +    ;       substring(string, int, int).    % string, start, end offset

I didn't commit this yet because the substring/3 data constructor
differs from the (deprecated) substring/3 function and substring/4
predicate. The former takes (start, end) offsets into the base string,
whereas the function and predicate take (start, count) arguments.
That might be a bit confusing.

Perhaps the string_piece constructor should be renamed to between/3,
or even substr/3. Thoughts? The function and predicate HAVE been
deprecated for a long time.

Peter


More information about the reviews mailing list