caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Marco Maggesi <maggesi@math.unice.fr>
To: caml-list@inria.fr
Subject: Two questions about Toploop
Date: Tue, 14 Feb 2006 17:19:24 +0000 (UTC)	[thread overview]
Message-ID: <dst3er$q28$1@sea.gmane.org> (raw)

Hi, I have two questions about Toploop:

  (1) Would be difficult to write a function that builds the list of
      all of all values of a certain type?  E.g. a function

         get_toploop_int : unit -> (string * int) list

      with the behavior

         let a = 2;;
         let b = 3;;
         get_toploop_int ();;
           ==> ["a", 2; "b", 3]

  (2) It seems that the function Toploop.getvalue works only with
      variables defined in the top environment but not in
      (sub)modules.  E.g.

        # Pervasives.exit;;
        - : int -> 'a = <fun>
        # Toploop.getvalue  "Pervasives.exit";;
        >> Fatal error: Pervasives.exit unbound at toplevel
        Exception: Misc.Fatal_error.

      Is it possible to inspect values in the environment relative to
      other modules?

M.


                 reply	other threads:[~2006-02-14 17:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='dst3er$q28$1@sea.gmane.org' \
    --to=maggesi@math.unice.fr \
    --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).