Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] native code debugging
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Florian Hars <florian@h...>
Subject: Re: [Caml-list] native code debugging
On Wed, Aug 08, 2001 at 07:36:04PM -0600, JayR wrote:
> Is the following a side effect of defining these
> at the top level?

> # let id2 = id id;;
> val id2 : '_a -> '_a = <fun>

No, its a side-effect of side-effects.
It is due to the so-called value restriction, which for some
reason beyond my momentary comprehension is needed to be able to
type programs with side-effects. Section 5.1.1 of the introduction
by Hickey (linked to from the Ocaml homepage under "On-line Tutorials"
explains exactly your problem.

# let id2 x = (id id) x;;
val id2 : 'a -> 'a = <fun>

should work.

Yours, Florian.
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr