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
Missing "String.unescaped" #3888
Comments
Comment author: anonymous I think you're looking for Token.eval_string. (Of course that's not to say that the same function shouldn't be added to the string module... It's highly illogical that it isn't there.) |
Comment author: gerd Funny enough it actually exists in some form: let unescape s = So I guess it is only a matter of exporting it. |
Comment author: @ygrek shouldn't it be "%S%!" ? |
Comment author: gerd @ygrek: I thought the end of input was already marked enough by the enclosing double quotes. But this can in deed make a difference for recognizing invalid s, e.g. s=""". So better use your format string. |
Comment author: @lefessan I have added Scanf.unescaped and String.map in the SVN. I will close this bug report if there is no complain about them. |
Comment author: @ygrek I guess it is impossible to put it in String module without creating circular dependency? |
Comment author: @lefessan Indeed, the other solution would be to re-implement it completely in String, and it is not really worth adding 30 lines of code (1/6 of string.ml) for that, when it is available as one line in Scanf. |
Original bug ID: 3888
Reporter: @mmottl
Assigned to: @lefessan
Status: closed (set by @xavierleroy on 2015-12-11T18:04:34Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 3.09.0
Fixed in version: 3.13.0+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @ygrek scientician
Bug description
It is funny that there is a "String.escaped" function but not the inverse "String.unescaped", which makes the escaping function pretty useless.
Could you please add this missing function to the String-module? Thanks!
Btw., there is a "map"-function in the String-module. Why not expose it in the interface?
Best regards,
Markus
The text was updated successfully, but these errors were encountered: