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
Pervasives.compare != Pervasives.compare
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-11-12 (10:50)
From: Stéphane_Glondu <steph@g...>
Subject: Re: [Caml-list] Pervasives.compare != Pervasives.compare
Le 12/11/2010 06:57, Elnatan Reisner a écrit :
> Playing around a bit more, I seemed to find that every time you access
> an 'external' function, you get a distinct reference (is there a better
> term?) to it. This seems a bit odd to me. Can someone explain?

Think of externals as constructors: they are always fully applied 
internally. So when you partially apply one (or use it with no 
arguments), the compiler eta-expands it and generates a closure that 
eats the remaining arguments and call the external.

You can use the -dinstr (in bytecode) or -S (in native code) 
command-line switch to see how things are actually compiled.