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

useful string functions not in String module #6036

Closed
vicuna opened this issue Jun 7, 2013 · 1 comment
Closed

useful string functions not in String module #6036

vicuna opened this issue Jun 7, 2013 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Jun 7, 2013

Original bug ID: 6036
Reporter: @c-cube
Status: closed (set by @xavierleroy on 2013-06-09T09:07:19Z)
Resolution: not a bug
Priority: normal
Severity: feature
Category: standard library

Bug description

This commit revert on the current trunk (504e86d) shows that some functions ("split" and "cut_at") are available in the compiler, but not in the standard library.

I often need the "split" function (e.g., to split the content of a small file into a list of lines, or a CLI option into arguments separated by ","). I don't know much about the policy for moving functions to the standard library. What are the reasons behind hidding those?

@vicuna
Copy link
Author

vicuna commented Jun 9, 2013

Comment author: @xavierleroy

The Str library, part of the core distribution, already provides a "split" function that is much more general than the Misc.split function you're talking about. For instance, the latter is unable to split at whitespace, and does arguably the wrong thing with starting or trailing occurrences of the delimiter. Likewise, Str already contains equivalent functionality to "cut_at".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant