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 GAA00505; Tue, 6 Mar 2001 06:46:58 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id GAA00320 for ; Tue, 6 Mar 2001 06:46:56 +0100 (MET) Received: from verdot.inria.fr (verdot.inria.fr [128.93.11.7]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f265ktb09611; Tue, 6 Mar 2001 06:46:55 +0100 (MET) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id GAA03634; Tue, 6 Mar 2001 06:46:55 +0100 Date: Tue, 6 Mar 2001 06:46:55 +0100 From: Daniel de Rauglaudre To: DURAK Berke Cc: caml-list@inria.fr Subject: Re: [Caml-list] Accessing the nth element in a stream takes time quadratic in n Message-ID: <20010306064655.A3629@verdot.inria.fr> References: <200103052250.XAA17502@amertume.ufr-info-p7.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0us In-Reply-To: <200103052250.XAA17502@amertume.ufr-info-p7.jussieu.fr>; from durak@ufr-info-p7.jussieu.fr on Mon, Mar 05, 2001 at 11:50:55PM +0100 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, On Mon, Mar 05, 2001 at 11:50:55PM +0100, DURAK Berke wrote: > This happens when streams are defined recursively, as in > > let rec nat_stream n = [< 'n; nat_stream (n + 1) >] > > and the problem holds for streams built of channels or strings, too. Preprocess by camlp4o (add "-pp camlp4o" among the options of ocamlc or ocamlopt). The streams and stream parsers in OCaml parser are not optimized. -- Daniel de RAUGLAUDRE daniel.de_rauglaudre@inria.fr http://cristal.inria.fr/~ddr/ ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr