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 QAA02403; Mon, 9 Sep 2002 16:23:23 +0200 (MET DST) 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 QAA03069 for ; Mon, 9 Sep 2002 16:23:22 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g89ENK113889; Mon, 9 Sep 2002 16:23:21 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA03068; Mon, 9 Sep 2002 16:23:20 +0200 (MET DST) Date: Mon, 9 Sep 2002 16:23:20 +0200 From: Xavier Leroy To: Alessandro Baretta Cc: Ocaml Subject: Re: [Caml-list] Has laziness changed type? Message-ID: <20020909162320.D1781@pauillac.inria.fr> References: <3D7A7C8B.9070901@baretta.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <3D7A7C8B.9070901@baretta.com>; from alex@baretta.com on Sun, Sep 08, 2002 at 12:24:11AM +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I think I recall Lazy.t being defined in 3.04 as = Value of > ... | Exception of ... | Suspension of ... > or something of the sort. Now Lazy.t is defined simply as > lazy_t. But what *is* lazy_t exactly? An abstract type. You don't want to know :-) More seriously: in 3.06, the compiler and runtime system represent lazy values more efficiently; in particular, the "Value of" indirections present in 3.04 are now shortened by the GC whenever possible. As a consequence, the representation of lazy values no longer matches that of a Caml datatype. > Can I apply pattern-matching on it? No. The general "contract" of a lazy value is that you should never have to distinguish whether it's been evaluated already or not. Just perform Lazy.force on the lazy value and match on the result. - Xavier Leroy ------------------- 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