caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Agustin Valverde Ramos <a_valverde@mac.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Better option to read a file
Date: Wed, 17 Mar 2004 17:42:13 +0100	[thread overview]
Message-ID: <0AEE851F-7832-11D8-910D-000A95CED312@mac.com> (raw)
In-Reply-To: <m34qso53qy.fsf@diebuntekuh.de>


El 17/03/2004, a las 8:31, Christoph Bauer escribió:

> 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 = 
ac^(Char.escaped c);;), but I have understood that, any case, this is a 
bad idea.

> `leer2' is `read the first line of file and don't close the file'.
> (Do you mean `let leer2 = 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 
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 
the newline char to reduce the size of the resulting string. So I don't 
know if I can apply the Chirstoph and Pietro ideas directly.

I think that the Markus suggestion is better for me, because I have 
never worked with ocamllex. By the way, can I obtain benefits in 
efficiency using ocamllex? because in this case I'll learn to use it.

Thanks for all answers

*******************************
*  Agustín Valverde Ramos
*  Dept. Matemática Aplicada
*  E.T.S. de Ingeniería Informática
*  Universidad de Málaga
*  Campus de Teatinos
*  29071 Málaga (España)
*  ---------------------------------
*  Tel:  (+34)  952132878
*  Fax: (+34)  952132746
*  mailto:a_valverde@ctima.uma.es
*  http://www.AgustinValverde.com
*  ---------------------------------
*  Soy miembro de GIMAC:
*  "Grupo de Investigación
*  en Matemática Aplicada para la Computación"
*  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


  reply	other threads:[~2004-03-17 16:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-16 21:28 Agustín Valverde
2004-03-17  3:48 ` Pietro Abate
2004-03-17  7:31 ` Christoph Bauer
2004-03-17 16:42   ` Agustin Valverde Ramos [this message]
2004-03-17 17:46     ` Markus Mottl
2004-03-17 18:20       ` Agustin Valverde Ramos
2004-03-17 18:54         ` Markus Mottl
2004-03-17  8:22 ` Jean-Christophe Filliatre
2004-03-17 10:11   ` Markus Mottl
  -- strict thread matches above, loose matches on Subject: below --
2004-03-16 20:38 Agustín Valverde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0AEE851F-7832-11D8-910D-000A95CED312@mac.com \
    --to=a_valverde@mac.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).