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 32DC4BD73 for ; Sat, 20 Aug 2005 11:17:17 +0200 (CEST) Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j7K9HGrh018598 for ; Sat, 20 Aug 2005 11:17:17 +0200 Received: from [192.168.0.1] (rke75-3-82-229-183-156.fbx.proxad.net [82.229.183.156]) by postfix4-2.free.fr (Postfix) with ESMTP id B77653213DA; Sat, 20 Aug 2005 11:17:16 +0200 (CEST) Message-ID: <4306F415.60806@inria.fr> Date: Sat, 20 Aug 2005 11:12:53 +0200 From: Alain Frisch User-Agent: Debian Thunderbird 1.0.2 (X11/20050331) X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?=22M=E1rk_S=2E_Zolt=E1n=22?= Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Parameter evaluation order References: <43065B83.6050503@dravanet.hu> In-Reply-To: <43065B83.6050503@dravanet.hu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 4306F51C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; frisch:01 frisch:01 caml-list:01 binary:01 semantically:01 wrote:01 argument:01 argument:01 closure:02 closure:02 parameter:02 parameter:02 functional:02 evaluates:02 alain:03 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 Márk S. Zoltán wrote: > But I do think that currying + strictness + side-effects => > left-to-right evaluation order. That is because a multi-parameter > function application should be functionally equivalent to a closure > taking the first (== leftmost) parameter and returning a closure which > takes the second parameter It is, but your conclusion about left-to-right evaluation order is wrong. It's just that the binary application operator evaluates first its second argument (the function's argument), then its first argument (the functional value), and finally applies the function to the argument. An application (e1 e2) is semantically equivalent to: (let y = e2 in let x = e1 in x y). Hence you get right-to-left evaluation order (but this is not specified). -- Alain