Version française
Home     About     Download     Resources     Contact us    
Browse thread
Efficiency of let/and
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: William Lovas <wlovas@s...>
Subject: Re: Ant: [Caml-list] Efficiency of let/and
On Mon, Sep 26, 2005 at 06:32:40AM +0200, Martin Chabr wrote:
> As it appears to me, there is no semantic difference
> between both alternatives. It can be shown with two
> dependent expressions y = 1 and z = y + 2:

This is not universally true:

> # let y = 1
>   and z = y + 2 in
>   z;;
> - : int = 3

            Objective Caml version 3.08.1

    # let y = 1
      and z = y + 2 in
      z;;
    Unbound value y

So either you are using a version older than 3.08.1 or this is a fairly
recent change.  In the latter case, people who wish to remain backward-
compatible might eschew this style for sequential bindings, regardless
of any potential performance problems.

William