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 DAA20396; Wed, 28 Jul 2004 03:16:06 +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 DAA20247 for ; Wed, 28 Jul 2004 03:16:04 +0200 (MET DST) Received: from trdlnk.com ([208.252.163.7]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6S1G3EV030004 for ; Wed, 28 Jul 2004 03:16:03 +0200 Received: from minglewood.chicago.trdlnk.com (minglewood [10.10.1.79]) by trdlnk.com (8.12.10+Sun/8.12.9) with ESMTP id i6S1Fg9o013000 for ; Tue, 27 Jul 2004 20:15:42 -0500 (CDT) Received: from minglewood.chicago.trdlnk.com (localhost [127.0.0.1]) by minglewood.chicago.trdlnk.com (8.12.10+Sun/8.12.9) with ESMTP id i6S1FgrO009072 for ; Tue, 27 Jul 2004 20:15:42 -0500 (CDT) Received: (from josh@localhost) by minglewood.chicago.trdlnk.com (8.12.10+Sun/8.12.9/Submit) id i6S1FgLZ009071 for caml-list@inria.fr; Tue, 27 Jul 2004 20:15:42 -0500 (CDT) Date: Tue, 27 Jul 2004 20:15:42 -0500 From: Josh Smith To: caml-list@inria.fr Subject: Re: [Caml-list] Camlp4 help/questions Message-ID: <20040728011542.GB7950@trdlnk.com> References: <20040727214504.GA7950@trdlnk.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Miltered: at nez-perce with ID 4106FE53.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 camlp:01 2004:99 function-:01 val:01 char:01 it'd:01 string:03 string:03 wrote:03 library:03 data:03 data:03 str:05 integers:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Jul 27, 2004 at 05:11:32PM -0500, Brian Hurt wrote: > > I think what you want is a split function- a function that takes a string > and splits it up at certan characters. It'd have a type something like: > val split: char -> string -> string list > > You'd then read an entire line, split it apart on '|'. You could then > split various substrings on ';' to get the integers, etc. This would work, and I've done it in the past. There is a split function in the Str library that would be able to handle this. The main problem with this is that it has to be changed a lot, and is error prone. The data file that I'm parsing is changing a lot and the line might tokenize correctly but not have the right data. > > Hope this helps. Thank you. -jbs ------------------- 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