From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Basile.Starynkevitch@cea.fr (Basile STARYNKEVITCH)
Cc: caml-list@inria.fr
Subject: Re: String wishes for Ocaml
Date: Thu, 3 Jul 1997 11:04:54 +0200 (MET DST) [thread overview]
Message-ID: <199707030904.LAA22534@pauillac.inria.fr> (raw)
In-Reply-To: <199707021239.OAA12596@vega.serma.cea.fr> from Basile STARYNKEVITCH at "Jul 2, 97 02:39:43 pm"
> I have some few small (except the 3rd) wishes for next Ocaml release,
> regarding string processing:
>
> 1. some more basic string utilities in the standard Ocaml library (not
> the Str package), like [...] strchr in C [...and...] strrchr in C
This is reasonable. Indeed, the Filename standard library module
defines the equivalent of strrchr for its internal usage.
> 2. perhaps something similar to strtok in C (but reentrant)
Str.split (from the OCaml regexp library) is strictly more powerful
than strtok, since it supports arbitrary regexps as delimiters.
> 3. Much harder. A sort of scanf facility. Perhaps the format could be
> a list of formatting element...
When programming in C, I've never found scanf() very useful. It does
not allow enough flexibility in defining the scanning syntax.
I'd rather scan lines the Perl way, using regular expressions
(Str.string_match + extraction of \(...\) components using
Str.matched_string and conversion to int or float if needed).
Regards,
- Xavier Leroy
next prev parent reply other threads:[~1997-07-03 18:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-07-02 12:39 Basile STARYNKEVITCH
1997-07-03 9:04 ` Xavier Leroy [this message]
1997-07-02 21:07 Robbert VanRenesse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199707030904.LAA22534@pauillac.inria.fr \
--to=xavier.leroy@inria.fr \
--cc=Basile.Starynkevitch@cea.fr \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox