Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jean-Baptiste Rouquier <jean-baptiste.rouquier@ens-lyon.org>
To: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] stream conversion
Date: Tue, 09 Dec 2003 18:40:16 +0100	[thread overview]
Message-ID: <3FD60900.2010901@ens-lyon.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0312090921270.15081-100000@grace.speakeasy.net>

brogoff@speakeasy.net wrote:

>The documentation in the Stream library for the stream builders (you use
>Stream.of_string) states :
>  
>
Ah yes, I remember reading that one year ago, sorry.
Here is a more readable solution :

#load "camlp4o.cma";;
let stream_of_string s =
  let len = String.length s in
  let rec stream pos =
    if pos < len then [< 's.[pos]; stream (pos+1) >] else [<>] in
  stream 0

let rec convert = parser
  | [< 'string; stream >] -> [<stream_of_string string; convert stream>]
  | [<>] -> [<>]

-------------------
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:[~2003-12-09 17:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-09  7:56 Dustin Sallings
2003-12-09 12:08 ` Remi Vanicat
2003-12-09 16:58   ` Jean-Baptiste Rouquier
2003-12-09 17:25     ` brogoff
2003-12-09 17:40       ` Jean-Baptiste Rouquier [this message]
2003-12-09 18:30       ` Tim Freeman
2003-12-16 22:42         ` Damien Doligez
2003-12-09 19:13     ` Dustin Sallings
2003-12-09 19:15   ` Dustin Sallings
2003-12-10  1:09 ` Nicolas Cannasse

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=3FD60900.2010901@ens-lyon.org \
    --to=jean-baptiste.rouquier@ens-lyon.org \
    --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