From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 56325BC29 for ; Fri, 11 Aug 2006 02:01:03 +0200 (CEST) Received: from ptb-relay02.plus.net (ptb-relay02.plus.net [212.159.14.213]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k7B012mg024875 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 11 Aug 2006 02:01:03 +0200 Received: from [80.229.56.224] (helo=[10.0.0.5]) by ptb-relay02.plus.net with esmtp (Exim) id 1GBKSD-0007Qg-AP for caml-list@yquem.inria.fr; Fri, 11 Aug 2006 01:00:45 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Streams Date: Fri, 11 Aug 2006 01:00:54 +0100 User-Agent: KMail/1.9.1 References: <5ebb1214.308e7ea.44db0fae.68763@o2.pl> In-Reply-To: <5ebb1214.308e7ea.44db0fae.68763@o2.pl> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608110100.54282.jon@ffconsultancy.com> X-Miltered: at concorde with ID 44DBC8BE.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; rec:01 parsing:01 camlp:01 camlp:01 parsing:01 rec:01 ocaml:01 2006:98 frog:98 wrote:01 caml-list:01 cma:01 lazy:02 lazy:02 caml:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Thursday 10 August 2006 11:51, Error404 wrote: > I'm looking for some streams related tutorial or any other info. > By stream i mean something like this (I don't know exact definition): > > open Lazy;; > type 'a stream = Nil | Cons of 'a Lazy.t * 'a stream Lazy.t;; > > (* For example stream of 'integers from x' would look like this: *) > > let rec intsfrom x = > Cons(lazy x,lazy (intsfrom (x+1)));; > > If you know any www/book or anything on this kind of streams please mail me > (error92@tlen.pl). Many thanks. I just posted a link to some stuff on streams in the context of parsing but you can write intsfrom as: # #load "camlp4o.cma";; Camlp4 Parsing version 3.09.2 # let rec intsfrom n = [< 'n; intsfrom(n+1) >];; -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists