Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend Text_Sub_Range with From_End_While #5512

Open
wdanilo opened this issue Feb 5, 2023 · 0 comments
Open

Extend Text_Sub_Range with From_End_While #5512

wdanilo opened this issue Feb 5, 2023 · 0 comments
Labels
-libs Libraries: New libraries to be implemented l-text p-low Low priority x-new-feature Type: new feature request

Comments

@wdanilo
Copy link
Member

wdanilo commented Feb 5, 2023

This task is automatically imported from the old Task Issue Board and it was originally created by Radosław Waśko.
Original issue is here.


While most constructors of Text_Sub_Range have pairs that work both from the beginning and end of the string, the While constructor does not have such a variant.

However it may be useful to take or drop some characters form the end of the string based on a predicate. Thus we should add a dual of While, called From_End_While which selects a range of characters satisfying the given predicate, but looking from the end of the string.

    ## Select characters from the end of the string while the predicate returns
       `True`.
    type From_End_While (predicate : (Text -> Boolean))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-libs Libraries: New libraries to be implemented l-text p-low Low priority x-new-feature Type: new feature request
Projects
None yet
Development

No branches or pull requests

1 participant