Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Basile STARYNKEVITCH <Basile.Starynkevitch@cea.fr>
To: caml-list@inria.fr
Subject: String wishes for Ocaml
Date: Wed, 2 Jul 1997 14:39:43 +0200	[thread overview]
Message-ID: <199707021239.OAA12596@vega.serma.cea.fr> (raw)



Hello All,

[[abreged french version below]]

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 :
      String.pos str ch = 
        search ch in str returning first position or raise Not_found

   * strrchr in C :
      String.last_pos str ch = 
        search ch in str returning last position or raise Not_found

   * String.substr str first last = get a substring of str from index
     first to last      (String.sub takes a length, not a last index)

2. perhaps something similar to strtok in C (but reentrant)

3. Much harder. A sort of scanf facility. Perhaps the format could be
a list of formatting element...

I know that this last point is difficult. Actually, the Format.printf
type inference mechanism (which seems built in the compiler, not in
the library) is stiff a bit of magic for me.


....................
 
[[-- version française abrégée - lire plutot l'anglais ci-dessus --]]

  
Quelques souhaits pour la prochaine version d'Ocaml relatifs aux
chaines de caractères.

1. Quelques utilitaires manquants, a la maniere de strchr & strrchr en
Ansi C. Ainsi que substr qui renvoie la sous-chaine de premier et
dernier rangs données

2. Quelques chose comme strtok en C

3. Bien plus difficile. Un scanf ou equivalent. Mais c'est difficile,
et pour moi, l'inference de type de Format.printf (qui me parait être
dans le compilateur, pas la librarie) reste magique pour moi.


Merci à tous

N.B. Any opinions expressed here are solely mine, and not of my organization.
N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA.


----------------------------------------------------------------------
Basile STARYNKEVITCH   ----  Commissariat à l Energie Atomique 
DRN/DMT/SERMA * CEA/Saclay bat.470 * 91191 GIF/YVETTE CEDEX * France
fax: (33) 01,69.08.85.68; phone: 01,69.08.40.66; home: 01,46.65.45.53
email: Basile . Starynkevitch @ cea . fr  (but remove white space)
I speak french, english, russian. Je parle français, anglais, russe.
----------------------------------------------------------------------






             reply	other threads:[~1997-07-02 17:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-02 12:39 Basile STARYNKEVITCH [this message]
1997-07-03  9:04 ` Xavier Leroy
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=199707021239.OAA12596@vega.serma.cea.fr \
    --to=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