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: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
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: