Browse thread
Efficiency of let/and
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Brian Hurt <bhurt@s...> |
| Subject: | Re: Ant: [Caml-list] Efficiency of let/and |
On Mon, 26 Sep 2005, 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:
>
> # let y = 1 in
> let z = y + 2 in
> z;;
> - : int = 3
Actually, my example would be more like:
let y = 1 in
let z = 2 in
...
vr.s
let y = 1
and z = 2
in
...
Or, more commonly, something like:
let foo arr1 arr2 =
(* I need the lengths of both arrays *)
let len1 = Array.length arr1
and len2 = Array.length arr2
in
...
Syntactically and semantically there is no difference. I was wondering if
the ocamlopt compiler took advatange of the implicit paralellism at all.
Brian