From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 8D984BC0A for ; Thu, 26 Apr 2007 10:52:13 +0200 (CEST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3Q8qDBm016562 for ; Thu, 26 Apr 2007 10:52:13 +0200 Received: by ug-out-1314.google.com with SMTP id q2so554858uge for ; Thu, 26 Apr 2007 01:52:12 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=gJoTuCwj4GTnWLn9opCC2da5J83AfSA65GlxPXUrOR5hjMgdBQXfQAeIRy9OGE71FBJUz7OUmqxWXkXSPThVHL1wPciGSoM1Q3y66P63sRYSLObjjMJxibhrJoKwAWS2wAPi4ddobAcNaRC8hQd12bvp6bvUM+F2YjQuKox61vI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=mt6ZdoVb9MB2H5cuEcUDJDOCu1VWTszPltO6FycEgg1z8JEBIkBHcjZCGvXRlXHnch0UylIfQI6GMYnQOP7oWuGHLTnKIWOdcd6KUDIQh4MvFnnMqzEtKHjcGbsYOWE19rv3IjzeR5iulvt+2U+gKgRrFHzYsJV+TW79FFSgh7g= Received: by 10.82.162.14 with SMTP id k14mr2798947bue.1177577532725; Thu, 26 Apr 2007 01:52:12 -0700 (PDT) Received: by 10.82.157.14 with HTTP; Thu, 26 Apr 2007 01:52:12 -0700 (PDT) Message-ID: Date: Thu, 26 Apr 2007 10:52:12 +0200 From: Tom To: skaller Subject: Re: [Caml-list] Function application implementation Cc: "Caml List" In-Reply-To: <1177557207.8088.27.camel@rosella.wigram> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_136563_31081516.1177577532687" References: <1177557207.8088.27.camel@rosella.wigram> X-j-chkmail-Score: MSGID : 4630683D.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 4630683D.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 W8:98 W8:98 sourceforge:01 sourceforge:01 wrote:01 wrote:01 caml-list:01 closure:01 closure:01 expression:02 expression:02 evaluates:02 evaluates:02 X-Attachments: cset="UTF-8" cset="UTF-8" ------=_Part_136563_31081516.1177577532687 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 26/04/07, skaller wrote: > > It knows the type of the function expression, and that is all > that is required. Incidentally Ocaml evaluates right to left. So > > f x y z > > will be roughly: > > push (eval z) > push (eval y) > push (eval x) > push (eval f) > apply > apply > apply But that doesn't explain how does each apply know what to do, either to build a new closure (in the case above, the first two applies) or to actually call the code (the third apply). - Tom ------=_Part_136563_31081516.1177577532687 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline

On 26/04/07, skaller <skaller@users.sourceforge.net> wrote:
It knows the type of the function expression, and that is all
that is required. Incidentally Ocaml evaluates right to left. So

        f x y z

will be roughly:

        push (eval z)
        push (eval y)
        push (eval x)
        push (eval f)
        apply
        apply
        apply

But that doesn't explain how does each apply know what to do, either to build a new closure (in the case above, the first two applies) or to actually call the code (the third apply).

 - Tom

------=_Part_136563_31081516.1177577532687--