Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Map + Set
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-07-28 (01:16)
From: Josh Smith <josh@t...>
Subject: Re: [Caml-list] Camlp4 help/questions
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.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: