From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA27282; Thu, 14 Jun 2001 21:37:47 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 VAA18771 for ; Thu, 14 Jun 2001 21:37:46 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f5EJbiX20726; Thu, 14 Jun 2001 21:37:44 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA27299; Thu, 14 Jun 2001 21:37:44 +0200 (MET DST) From: Pierre Weis Message-Id: <200106141937.VAA27299@pauillac.inria.fr> Subject: Re: [Caml-list] pretty printers and format and matrices In-Reply-To: <15143.22914.894206.676827@gargle.gargle.HOWL> from Hendrik Tews at "Jun 13, 101 02:16:02 pm" To: tews@tcs.inf.tu-dresden.de (Hendrik Tews) Date: Thu, 14 Jun 2001 21:37:44 +0200 (MET DST) Cc: caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Hi, > > I have another question about the format module: > > How can I set max_boxes to infinity? > > We use the format module to output source code of a programming > language. For that one needs a way to advice the format module to > print everything, regardless of how deep boxes are nested. At the > moment we use (set_max_boxes 1000), and when we run into problems > we increase the number. > > > Bye, > > Hendrik > ------------------- > Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ > To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Having to open more than 1000 boxes to print any material seems incredible to me, since I used to pretty print an entire Caml compiler within 35 boxes. Anyway, I'm afraid there is no notion of infinity in Format. Neither in the Caml integer values. Hence no solution to your problem. The best you can do is to use a rough approximation, as in: set_max_boxes max_int;; On a regular machine this allows to simultaneously open no more than 4611686018427387903 boxes, which could be large enough to pretty print a huge source chunk of your programming language source programs. On the other hand, on my Ipaq handheld this limit is much smaller than that, namely 1073741823 which may be really short for you. If you need more than max_int simultaneously open boxes, you should rewrite the Format module using the bignumbers facility of Caml. However, I should admit that you will still be facing another stupid limit (no more than 2^30 words in a big integer, which means approximately 9 * 2 ^ 30 decimal digits on a little machine, once more far far away from infinity). If you really need infinity, I am not aware of any practical solution in Objective Caml. Sorry for this unsatisfactory answer, due to stupid limitations in the language. Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/ ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr