From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA03092; Mon, 2 Dec 2002 17:30:12 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA04229 for ; Mon, 2 Dec 2002 17:30:11 +0100 (MET) Received: from mailhost.tni.fr (firewall.tni.fr [195.25.255.61]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id gB2GU8100906 for ; Mon, 2 Dec 2002 17:30:10 +0100 (MET) Received: from groscool.tni.fr ([195.25.255.1]) by mailhost.tni.fr (Netscape Messaging Server 3.62) with SMTP id 4434; Mon, 2 Dec 2002 17:29:46 +0100 Received: from 192.168.7.60 by groscool.tni.fr (InterScan E-Mail VirusWall NT); Mon, 02 Dec 2002 17:29:45 +0100 (Paris, Madrid) Message-ID: <3DEB8A67.ED09100@tni.fr> Date: Mon, 02 Dec 2002 17:29:27 +0100 From: "sebastien FURIC" X-Mailer: Mozilla 4.7 [fr] (WinNT; I) X-Accept-Language: fr MIME-Version: 1.0 To: "altavillasalvatore@libero.it" CC: caml-list Subject: Re: [Caml-list] function References: Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk "altavillasalvatore@libero.it" a écrit : > > Hi all, > I would want to know if a function exists that allows me to make this: > > ["123";"45";"678"] -> [1;2;3;4;5;6;7;8;]. > You could split the problem into several simple ones: - Given a strings, return the list of its characters: explode : string -> char list - Given a list of chars, return a list of ints using List.map: chars_to_ints : char list -> int list - And then, given a list of strings, apply a composition of the previous functions to it (and collect the results) using List.fold_right for instance... Regards, Sebastien. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners