Hi,

Jérémie Dimino wrote on Fri, Dec 23, 2011 :
> # let env = !Toploop.toplevel_env;;
> val env : Env.t = <abstr>
> # let x = 1;;
> val x : int = 1
> # Toploop.toplevel_env := env;;
> - : unit = ()
> # x;;
> Characters 0-1:
> Error: Unbound value x

Thanks!
I've even found Toploop.initialize_toplevel_env () that does exactly
what I wanted thanks to you :)


It might be a good idea to make it more obvious or name it in the handy
commands of the website then - I really believe that people, especially
beginners or when toying around, want to clean their environment
often. I though about it because I just had something weird I could not
explain because the first thing I did was define a global x, and 10
minutes later it came back inside a function where I shouldn't have had
an x...
Maybe reset it when changing lesson? (though that might be unwanted
sometimes too, I don't know.)


Cheers,
-- 
Dominique Martinet | Asmadeus

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to