You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1145 Reporter: administrator Status: closed Resolution: not a bug Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
However, according to the spec it should return "all chars that precede position
n".
In this case, the answer should be "f" since "f" are all chars that precede 2.
(In general, I think this is a general design flaw in the string-functions of
O'Caml, they should rarely return exception, just shorter strings. If
a programmer wants the behavior of string_before, he should check the
length himself. Strings are not arrays.
The current implementation makes it difficult just to check if a string
starts with "%%")
The text was updated successfully, but these errors were encountered:
Original bug ID: 1145
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: mattias waldau
Version: 3.04
OS: rh72
Submission from: h175n2fls34o849.telia.com (217.208.235.175)
Str.string_before "f" 2 returns exception Invalid_argument.
However, according to the spec it should return "all chars that precede position
n".
In this case, the answer should be "f" since "f" are all chars that precede 2.
(In general, I think this is a general design flaw in the string-functions of
O'Caml, they should rarely return exception, just shorter strings. If
a programmer wants the behavior of string_before, he should check the
length himself. Strings are not arrays.
The current implementation makes it difficult just to check if a string
starts with "%%")
The text was updated successfully, but these errors were encountered: