[m-rev.] for review: Add predicates to find chars in strings.
Julien Fischer
jfischer at opturion.com
Fri Jul 19 17:34:43 AEST 2024
On Fri, 19 Jul 2024 at 16:57, Peter Wang <novalazy at gmail.com> wrote:
>
> Add the following predicates to find the first or last occurrence of a
> code point in a string:
Please use a shorter summary line (plays better with various git-related
tools).
>
> find_first_char
> We already had the code to implement contains_char.
> Not strictly necessary as we have sub_string_search.
Yes, but it's a better name for it.
> find_first_char_start
> Safe wrapper for unsafe_find_first_char_start.
>
> unsafe_find_first_char_start
> This is just the body of find_first_char, which should be useful for
> users. Not strictly needed as we have sub_string_search_start.
...
> library/string.m:
> Add the predicates above.
>
> Implement string.contains_char using string.find_first_char.
>
> tests/hard_coded/Mmakefile:
> tests/hard_coded/string_find_char.exp:
> tests/hard_coded/string_find_char.exp2:
> tests/hard_coded/string_find_char.m:
> Add test case.
>
> NEWS.md:
> Announce additions.
>
That looks fine.
Julien.
More information about the reviews
mailing list