caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus77@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] try ocaml website
Date: Fri, 23 Dec 2011 20:39:06 +0100	[thread overview]
Message-ID: <20111223193906.GA19179@nautica> (raw)
In-Reply-To: <1324668549.22984.93.camel@aurora>

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

  reply	other threads:[~2011-12-23 19:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-23 18:00 Fabrice Le Fessant
2011-12-23 18:40 ` Dominique Martinet
2011-12-23 18:49   ` Çagdas Bozman
2011-12-23 19:10     ` Dominique Martinet
2011-12-23 19:29       ` Jérémie Dimino
2011-12-23 19:39         ` Dominique Martinet [this message]
2011-12-23 21:35         ` oliver
2011-12-23 19:36       ` Adrien
2011-12-26  8:09     ` Gabriel Scherer
2011-12-27 20:23       ` Fabrice Le Fessant
2011-12-23 18:40 ` oliver
2011-12-24  8:51   ` Stéphane Glondu
2011-12-24 10:16     ` oliver
2011-12-24 10:31       ` Dominique Martinet
2011-12-23 18:54 ` Török Edwin
2011-12-23 21:27   ` oliver
2011-12-23 18:56 ` Ashish Agarwal
2011-12-23 19:15   ` Philippe Strauss
2011-12-23 21:14     ` Norman Hardy
2011-12-23 21:18       ` William Le Ferrand
2011-12-23 21:32   ` oliver
2011-12-26  8:50 ` Mihamina Rakotomandimby
2011-12-26  9:05 ` Esther Baruk
2012-01-03 22:12 ` Philippe Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111223193906.GA19179@nautica \
    --to=asmadeus77@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).