caml-list - the Caml user's mailing list
 help / Atom feed
* [Caml-list] Checking the usage of “Str.search_forward”
@ 2019-06-06  8:33 Markus Elfring
  2019-06-06 11:34 ` Nicolás Ojeda Bär
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Elfring @ 2019-06-06  8:33 UTC (permalink / raw)
  To: caml-list

Hello,

I would like to use OCaml code like “try ignore (Str.search_forward (Str.regexp " when done") xb 6); …”.
Now I am looking for the explanation of the message “Fatal error:
exception Invalid_argument("Str.search_forward")”.

Regards,
Markus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Checking the usage of “Str.search_forward”
  2019-06-06  8:33 [Caml-list] Checking the usage of “Str.search_forward” Markus Elfring
@ 2019-06-06 11:34 ` Nicolás Ojeda Bär
  2019-06-06 14:13   ` Markus Elfring
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolás Ojeda Bär @ 2019-06-06 11:34 UTC (permalink / raw)
  To: Markus Elfring; +Cc: OCaml Mailing List

Hi Markus,

Are you sure that String.length xb >= 6 ?

Cheers,
Nicolás

On Thu, Jun 6, 2019 at 10:33 AM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> Hello,
>
> I would like to use OCaml code like “try ignore (Str.search_forward (Str.regexp " when done") xb 6); …”.
> Now I am looking for the explanation of the message “Fatal error:
> exception Invalid_argument("Str.search_forward")”.
>
> Regards,
> Markus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Checking the usage of “Str.search_forward”
  2019-06-06 11:34 ` Nicolás Ojeda Bär
@ 2019-06-06 14:13   ` Markus Elfring
  2019-06-07  8:07     ` David Allsopp
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Elfring @ 2019-06-06 14:13 UTC (permalink / raw)
  To: Nicolás Ojeda Bär; +Cc: caml-list

> Are you sure that String.length xb >= 6 ?

* Do you expect the information “Raises Invalid_argument if the string length
  is shorter than the passed start position”?

* Would an extension become helpful for the documentation of this function call?

Regards,
Markus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [Caml-list] Checking the usage of “Str.search_forward”
  2019-06-06 14:13   ` Markus Elfring
@ 2019-06-07  8:07     ` David Allsopp
  0 siblings, 0 replies; 4+ messages in thread
From: David Allsopp @ 2019-06-07  8:07 UTC (permalink / raw)
  To: Markus Elfring, Nicolás Ojeda Bär; +Cc: caml-list

Markus Elfring wrote:
> > Are you sure that String.length xb >= 6 ?
> 
> * Do you expect the information “Raises Invalid_argument if the string
>   length is shorter than the passed start position”?

Yes, cf. https://caml.inria.fr/pub/docs/manual-ocaml/libref/String.html#VALindex_from

> * Would an extension become helpful for the documentation of this 
> function call?

Yes - would you be able to make a pull request?


David



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06  8:33 [Caml-list] Checking the usage of “Str.search_forward” Markus Elfring
2019-06-06 11:34 ` Nicolás Ojeda Bär
2019-06-06 14:13   ` Markus Elfring
2019-06-07  8:07     ` David Allsopp

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror https://inbox.ocaml.org/caml-list

AGPL code for this site: git clone https://public-inbox.org/ public-inbox