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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id E5B65BB83 for ; Wed, 26 Apr 2006 21:45:06 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k3QJj6P9027680 for ; Wed, 26 Apr 2006 21:45:06 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA02464 for ; Wed, 26 Apr 2006 21:45:05 +0200 (MET DST) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k3QJj4n8027673 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Wed, 26 Apr 2006 21:45:05 +0200 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1FYpwc-0002od-IA for caml-list@inria.fr; Wed, 26 Apr 2006 21:45:02 +0200 Received: from 209.213.205.130 ([209.213.205.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 26 Apr 2006 21:45:02 +0200 Received: from sds by 209.213.205.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 26 Apr 2006 21:45:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: caml-list@inria.fr To: caml-list@inria.fr From: Sam Steingold Subject: programmatic access to toplevel print facilities Date: Wed, 26 Apr 2006 14:59:02 -0400 Organization: disorganization Message-ID: Reply-To: sds@podval.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 209.213.205.130 Mail-Copies-To: never X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:oVBE8p2NUqIxp5SBwdlCw+N5sbs= Sender: news X-Miltered: at nez-perce with ID 444FCDC2.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 444FCDC0.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; programmatic:01 toplevel:01 ocaml:01 toploop:01 struct:01 val:01 struct:01 ocaml:01 toploop:01 structs:01 structs:01 fedora:01 lisp:01 top-level:02 winnt:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.6 required=5.0 tests=RCVD_BY_IP,RCVD_NUMERIC_HELO autolearn=disabled version=3.0.3 is there a way to access the top-level printing facilities from a program? e.g., ocaml toploop will print a complex structure nicely: # let x = make_my_huge_struct ();; val x : my_huge_struct = {a = 1; b = 2; c = 3; ...} how do I access this from a program? e.g., if I have an array of my_huge_struct, I want to be able to examine a part of it: let show_part arr p1 p2 = for i = p1 to p2 do ocaml_toploop_print (Array.get arr i) done # show_part array_of_huge_structs 100 105;; (in lisp I would do (loop :for i :from p1 :to p2 :do (print (aref array_of_huge_structs i)))) -- Sam Steingold (http://www.podval.org/~sds) on Fedora Core release 5 (Bordeaux) http://ffii.org http://truepeace.org http://palestinefacts.org http://memri.org http://dhimmi.com http://openvotingconsortium.org Your mouse has moved - WinNT has to be restarted for this to take effect.