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 TAA23396; Thu, 22 Jul 2004 19:03:54 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA22855 for ; Thu, 22 Jul 2004 19:03:53 +0200 (MET DST) Received: from nexus.stwing.upenn.edu (NEXUS.STWING.UPENN.EDU [165.123.132.61]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6MH3qEV011075 for ; Thu, 22 Jul 2004 19:03:52 +0200 Received: from force.stwing.upenn.edu (force.stwing.upenn.edu [165.123.132.65]) by nexus.stwing.upenn.edu (8.12.10/8.12.9) with ESMTP id i6MH3ofn029256 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 22 Jul 2004 13:03:51 -0400 (EDT) Received: from force.stwing.upenn.edu (localhost [127.0.0.1]) by force.stwing.upenn.edu (8.12.10/8.12.9) with ESMTP id i6MH3ohs002088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 22 Jul 2004 13:03:50 -0400 (EDT) Received: (from wlovas@localhost) by force.stwing.upenn.edu (8.12.10/8.12.9/Submit) id i6MH3oxe002087 for caml-list@inria.fr; Thu, 22 Jul 2004 13:03:50 -0400 (EDT) Date: Thu, 22 Jul 2004 13:03:49 -0400 From: William Lovas To: caml-list@inria.fr Subject: Re: lazyness in ocaml (was : [Caml-list] kprintf with user formatters) Message-ID: <20040722170349.GA29172@force.stwing.upenn.edu> Mail-Followup-To: caml-list@inria.fr References: <200407211552.RAA04351@pauillac.inria.fr> <6DA682B9-DB3D-11D8-9D25-000393DBC266@epfl.ch> <20040722182851.B18239@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040722182851.B18239@pauillac.inria.fr> User-Agent: Mutt/1.5.4i X-Miltered: at nez-perce with ID 40FFF378.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; lovas:01 wlovas:01 stwing:01 lazyness:01 caml-list:01 kprintf:01 formatters:01 2004:99 pierre:01 weis:01 lazyness:01 higher-order:01 wadler's:01 implemented:01 camlp:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, Jul 22, 2004 at 06:28:51PM +0200, Pierre Weis wrote: > > A more lightweight notation would be needed in order to do real lazy > > programming in ocaml. At that time I wondered if specifiying the > > lazyness when one defines the function and not when one uses it would > > be a problem (I mean a technical problem, not an ideological one). > > For example if one defines > > > > let f (lazy x) = ... > > > > then the application f (x + y) would implicitely mean f (lazy (x + y)). > > [...] > > This has to be precisely ruled out and the necessary proofs have to be > made, but I think it could work (including for higher-order > functional, map, fold, and so on). I mean, I don't see any trivial > counter-example that would ruin this scheme. Wao! If this rule > turned out to be usable, it would be a major improvement for lazy > evaluation in our favorite language. This is reminiscent of the notation in Wadler's paper, "How to add laziness to a strict language, without even being odd"[1]. He even gives the semantics as a translation into the delay/force ("odd") style already supported in O'Caml, similar to this proposal. Perhaps it could even be implemented in camlp4, without any need for type-based transformations. William [1] http://homepages.inf.ed.ac.uk/wadler/papers/lazyinstrict/lazyinstrict.txt ------------------- 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