From: Francois-Rene Rideau <fare@tunes.org>
To: caml-list@inria.fr
Subject: String.from_list
Date: Tue, 13 Jul 1999 16:16:42 +0200 [thread overview]
Message-ID: <19990713161642.A22955@ZhengHe.augustin.thierry> (raw)
Chers camelots,
David Madore me suggère de vous envoyer les fonctions suivantes
pour inclusion dans string.ml, avec l'espoir qu'elles satisferont notamment
les habitués de Scheme (ou ceux qui traduisent des programmes écrit dans
ce langage) et qui cherchent de telles fonctions en standard.
let from_list l =
let s = make (List.length l) '\042' in
let rec f i l =
match l with
[] -> s
| c::r -> unsafe_set s i c ; f (i+1) r
in f 0 l ;;
let to_list s =
let rec t i l =
if i = 0 then l else
let j = i-1 in f j ((unsafe_get s j)::l)
in t (length s) [] ;;
Sinon, je n'ai jamais compris si les
[an error occurred while processing this directive]
présents un peu partout sur le site de CAML.inria.fr
étaient intentionnels ou involontaires.
Dans le premier un cas,
un <!--commentaire--> adéquat détromperait le lecteur avisé.
En tout cas, j'ai trouvé ça drôle,
et me suis permis de reprendre la blague à mon compte...
NB: je ne suis pas sur la liste.
Amicamlement,
[ "Faré" | VN: Уng-Vû Bân | Join the TUNES project! http://www.tunes.org/ ]
[ FR: François-René Rideau | TUNES is a Useful, Nevertheless Expedient System ]
[ Reflection&Cybernethics | Project for a Free Reflective Computing System ]
Keep things as simple as you can, but no simpler.
-- Albert Einstein
s/things/explanation/ ; s/A.*Einstein/Occam/
reply other threads:[~1999-07-13 19:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=19990713161642.A22955@ZhengHe.augustin.thierry \
--to=fare@tunes.org \
--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