From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id A5FA0BDC5; Tue, 23 Aug 2005 09:12:40 +0200 (CEST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j7N7Cclj026716; Tue, 23 Aug 2005 09:12:39 +0200 Received: from rosella (ppp13-11.lns2.syd7.internode.on.net [59.167.13.11]) by smtp3.adl2.internode.on.net (8.12.9/8.12.6) with ESMTP id j7N7CYeG053372; Tue, 23 Aug 2005 16:42:35 +0930 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] Parameter evaluation order From: skaller To: Damien Doligez Cc: caml-list In-Reply-To: <254E6767-A097-455B-872B-483725D26744@inria.fr> References: <43065B83.6050503@dravanet.hu> <254E6767-A097-455B-872B-483725D26744@inria.fr> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-xfgii+DoO3nFB+uIChNB" Date: Tue, 23 Aug 2005 17:12:34 +1000 Message-Id: <1124781154.8832.12.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 X-Miltered: at concorde with ID 430ACC66.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 damien:01 curried:01 evalue:01 annotations:01 lazy:01 totality:01 terminate:01 wrote:01 exception:01 sourceforge:01 sourceforge:01 writes:01 doligez:01 exceptions:01 X-Attachments: type="application/pgp-signature" name="signature.asc" 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 --=-xfgii+DoO3nFB+uIChNB Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2005-08-22 at 18:50 +0200, Damien Doligez wrote: > Suppose you want to evaluate a curried function call in left-to-right =20 > order: > f e1 e2 e3 e4 >=20 > You must evaluate f first, then e1. Then you must apply f to e1, giving > a new function g1. Then you must evalue e2, then apply f1 to e2, giving > f2, etc. >=20 > That's because f might do some side effects between its arguments. =20 what data, and possibly annotations, would be required to solve this problem? For example if all functions are total and pure=20 then the above problem vanishes. Felix doesn't permit functions to have side-effects, however this isn't enough for full optimisation in=20 the presence of exceptions, for example. Additionally, lazy evaluation can save the setting of a variable, a sufficient condition being purity (non-dependence on variables as well as having no side-effects) *and* totality. Seems like these properties: * writes variables (side-effect) * reads variables (side-dependence) * raises exception * fails to terminate impact evaluation strategy. It would be good to know which properties of things would allow which evaluation strategies. --=20 John Skaller --=-xfgii+DoO3nFB+uIChNB Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBDCsxgsRp8/9aGVGsRAlJlAJsFAuz+0++Rb6ROtUg6GOuW1pIWqwCfQEjC s5saSQMYm74v0YHT0MSVEfw= =5JeO -----END PGP SIGNATURE----- --=-xfgii+DoO3nFB+uIChNB--