English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Function application implementation
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-04-26 (08:52)
From: Tom <tom.primozic@g...>
Subject: Re: [Caml-list] Function application implementation
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