From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 07E63BB81 for ; Tue, 14 Feb 2006 18:19:55 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k1EHJsFV007190 for ; Tue, 14 Feb 2006 18:19:54 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA06182 for ; Tue, 14 Feb 2006 18:19:53 +0100 (MET) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k1EHJrOq007183 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Tue, 14 Feb 2006 18:19:53 +0100 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1F93q4-0002m6-VQ for caml-list@inria.fr; Tue, 14 Feb 2006 18:19:44 +0100 Received: from visnu.math.unifi.it ([150.217.33.18]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Feb 2006 18:19:44 +0100 Received: from maggesi by visnu.math.unifi.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Feb 2006 18:19:44 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Marco Maggesi Subject: Two questions about Toploop Date: Tue, 14 Feb 2006 17:19:24 +0000 (UTC) Message-ID: X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: visnu.math.unifi.it User-Agent: slrn/0.9.8.1 (Linux) Sender: news X-Miltered: at concorde with ID 43F2113A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 43F21139.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; toploop:01 toploop:01 pervasives:01 pervasives:01 toplevel:01 unbound:01 exception:01 int:01 int:01 modules:01 modules:01 defined:01 variables:02 string:02 seems:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 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 = # 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.