Version française
Home     About     Download     Resources     Contact us    
Browse thread
Changes on equality between 3.06 and 3.08.3
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Marcin 'Qrczak' Kowalczyk <qrczak@k...>
Subject: Re: [Caml-list] Changes on equality between 3.06 and 3.08.3
Olivier Andrieu <andrieu@ijm.jussieu.fr> writes:

>  > # (==) (==) (==);;
>  > - : bool = false
>
> Probably because == is defined by an "external" in pervasives.ml,
> not a regular function definition. So here, when you use (==),
> you're building three closures.

Two. OCaml materializes function objects corresponding to external
functions each time they are used instead of once at the point of
their definition (presumably because it assumes that usually they are
not passed as first-class objects at all), but application of such
function doesn't need the function object but jumps straight to its
machine code.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak@knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/