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 QAA14731; Fri, 4 May 2001 16:00:18 +0200 (MET DST) 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 QAA14740 for ; Fri, 4 May 2001 16:00:17 +0200 (MET DST) Received: from www.invert.com (invert.com [209.164.21.15]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f44E0Gr09700 for ; Fri, 4 May 2001 16:00:16 +0200 (MET DST) Received: (from miles@localhost) by www.invert.com (8.10.1/8.10.1AA) id f44E0E935335 for caml-list@inria.fr; Fri, 4 May 2001 07:00:14 -0700 (PDT) (envelope-from miles) Date: Fri, 4 May 2001 07:00:14 -0700 From: Miles Egan To: caml-list@inria.fr Subject: Re: [Caml-list] printable digest strings Message-ID: <20010504070014.A35277@caddr.com> References: <20010503153234.A28259@caddr.com> <20010504113727.A9728@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010504113727.A9728@pauillac.inria.fr>; from Xavier.Leroy@inria.fr on Fri, May 04, 2001 at 11:37:27AM +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, May 04, 2001 at 11:37:27AM +0200, Xavier Leroy wrote: > let string_map f s = > let rec map_aux res idx = > if idx < 0 then res else map_aux (f s.[idx] :: res) (idx - 1) > in map_aux [] (String.length s - 1) > > let hexstring s = > String.concat "" > (string_map (fun c -> Printf.sprintf "%02x" (Char.code c)) s) I knew there had to be a better way. Thanks. This actually brings me to my next question. There doesn't seem to be a String.map or String.iter function in the standard library, although I can imagine they might also be handy. Am I looking in the wrong place? -- miles ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr