Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Toplevel question ...
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-03-06 (10:41)
From: Mattias Waldau <mattias.waldau@a...>
Subject: RE: [Caml-list] Toplevel question ...
So it would be as if 

expr ;;

whould have been written as

let it = expr ;;

in the top-level. Since I currently often write

let x = expr ;;

it would save me 9 keystrokes. I think it is a good idea.

(But I think that soon people would ask you to keep all the
lines, so that we would write it.(4) instead.)


> -----Original Message-----
> From: 
> [] On Behalf Of Xavier Leroy
> Sent: Wednesday, March 06, 2002 11:25 AM
> To: Caml List
> Cc:
> Subject: Re: [Caml-list] Toplevel question ...
> > Is there some alias in toplevel for the result of last 
> evaluation so 
> > one could use it instead of retyping (there's no history completion 
> > :() and binding to some name?
> The original Caml V3.1 had such a facility -- all results of 
> toplevel evaluations were bound to the name "it".  This was 
> removed in Caml Light because of the way Caml Light handles 
> toplevel binding: all bindings accumulate forever, preventing 
> the GC from reclaiming the memory space used.  Early versions 
> of Objective Caml had the same problem as Caml Light, but 
> this was fixed in version 3.01: only the values of lexically 
> visible toplevel definitions are kept.
> So, technically, it would be feasible to resurrect the Caml V3.1
> behavior: evaluating "expr ;;" at top-level binds the result 
> value to the name "it".  Do others think that it would be useful?
> - Xavier Leroy
> -------------------
> To unsubscribe, mail Archives: Bug reports:
FAQ: Beginner's list:

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: