<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2006/02/677fc619054a7234febb4949a37cd7f0"
  from="Marco Maggesi &lt;maggesi@m...&gt;"
  author="Marco Maggesi"
  date="2006-02-14T17:19:55"
  subject="Two questions about Toploop"
  prev="2006/02/7f1fb00a556878588a6f8dfc3a2b39fc"
  next="2006/02/09c4695f392afeb7ebbe19b2611ddd5b"
  prev-thread="2006/02/7f1fb00a556878588a6f8dfc3a2b39fc"
  next-thread="2006/02/09c4695f392afeb7ebbe19b2611ddd5b"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Two questions about Toploop">
<msg 
  url="2006/02/677fc619054a7234febb4949a37cd7f0"
  from="Marco Maggesi &lt;maggesi@m...&gt;"
  author="Marco Maggesi"
  date="2006-02-14T17:19:55"
  subject="Two questions about Toploop">
</msg>
</thread>

<contents>
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 -&gt; (string * int) list

      with the behavior

         let a = 2;;
         let b = 3;;
         get_toploop_int ();;
           ==&gt; ["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 -&gt; 'a = &lt;fun&gt;
        # Toploop.getvalue  "Pervasives.exit";;
        &gt;&gt; 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.

</contents>

</message>

