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 RAA28416; Wed, 17 Mar 2004 17:42:31 +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 RAA29449 for ; Wed, 17 Mar 2004 17:42:30 +0100 (MET) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.47]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i2HGguKW027200 for ; Wed, 17 Mar 2004 17:42:57 +0100 Received: from mac.com (smtpin07-en2 [10.13.10.152]) by smtpout.mac.com (8.12.6/MantshX 2.0) with ESMTP id i2HGgRZM021801 for ; Wed, 17 Mar 2004 08:42:27 -0800 (PST) Received: from [172.26.0.5] (243.red-217-127-9.pooles.rima-tde.net [217.127.9.243]) (authenticated bits=0) by mac.com (Xserve/smtpin07/MantshX 3.0) with ESMTP id i2HGgPcR018532 for ; Wed, 17 Mar 2004 08:42:26 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v612) In-Reply-To: References: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: <0AEE851F-7832-11D8-910D-000A95CED312@mac.com> Content-Transfer-Encoding: quoted-printable From: Agustin Valverde Ramos Subject: Re: [Caml-list] Better option to read a file Date: Wed, 17 Mar 2004 17:42:13 +0100 To: caml-list@inria.fr X-Mailer: Apple Mail (2.612) X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 bauer:01 escribi:01 char:01 line':01 char:01 pietro:01 agust:01 matem:01 aplicada:01 laga:01 laga:01 ctima:01 gimac:01 matem:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 155 El 17/03/2004, a las 8:31, Christoph Bauer escribi=F3: > I'm not quite sure, what you want. `leer' reads a whole file (this > whitout a upper limit on `long' a bad idea), The unlimited long is the unique problem or is there another drawbacks? > `unir' doesn't work and Yes, I wrote bad the definition in the email (let rec unir c ac =3D=20 ac^(Char.escaped c);;), but I have understood that, any case, this is a=20= bad idea. > `leer2' is `read the first line of file and don't close the file'. > (Do you mean `let leer2 =3D input_line'?) > > Because of `leer2', I assume you have a parser operating on lines. No, my parser works over all the file content. I want to read formulas=20= like the following: ((p | (r -> t)) & (q | (t -> s))) -> ((p & -(q -> -t)) | (r -> ((q -> (s | r)) & s))) For example, I have a file of 752Kb with 770028 characters and I forget=20= the newline char to reduce the size of the resulting string. So I don't=20= know if I can apply the Chirstoph and Pietro ideas directly. I think that the Markus suggestion is better for me, because I have=20 never worked with ocamllex. By the way, can I obtain benefits in=20 efficiency using ocamllex? because in this case I'll learn to use it. Thanks for all answers ******************************* * Agust=EDn Valverde Ramos * Dept. Matem=E1tica Aplicada * E.T.S. de Ingenier=EDa Inform=E1tica * Universidad de M=E1laga * Campus de Teatinos * 29071 M=E1laga (Espa=F1a) * --------------------------------- * Tel: (+34) 952132878 * Fax: (+34) 952132746 * mailto:a_valverde@ctima.uma.es * http://www.AgustinValverde.com * --------------------------------- * Soy miembro de GIMAC: * "Grupo de Investigaci=F3n * en Matem=E1tica Aplicada para la Computaci=F3n" * http://batllo.informatica.uma.es/aciego/gimac-home.html * * I am member of GIMAC: * "Research Group in Applied Mathematics for * Computer Science" * http://batllo.informatica.uma.es/aciego/gimac-home-eng.html ******************************* ------------------- 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