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: Bill Wood <william.wood3@c...>
Subject: Re: Ant: [Caml-list] Efficiency of let/and
   . . .
> 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.

I'm using Objective Caml version 3.08.3 and had this interaction:
    # let y = 1
      and z = y + 2 in
        z;;
    Unbound value y
    #

 -- Bill Wood
    bill.wood@acm.org