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 IAA08552; Thu, 14 Jun 2001 08:46:36 +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 IAA08774 for ; Thu, 14 Jun 2001 08:46:35 +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 f5E6kWX25757; Thu, 14 Jun 2001 08:46:32 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA08311; Thu, 14 Jun 2001 08:46:32 +0200 (MET DST) From: Pierre Weis Message-Id: <200106140646.IAA08311@pauillac.inria.fr> Subject: Re: [Caml-list] pretty printers and format and matrices In-Reply-To: <4.3.2.7.2.20010612135731.029837a0@shell16.ba.best.com> from Chris Hecker at "Jun 12, 101 02:01:27 pm" To: checker@d6.com (Chris Hecker) Date: Thu, 14 Jun 2001 08:46:31 +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 > > >Once one gets used to it, it's really fun so don't give up... > > I had the choice of "try to get the formatting working for no other > reason than curiosity" or "write more real code on my game", so the > latter edged it out. :) > > > let print2d ppf a = > > This works better, thanks! I swear I tried something exactly like that... > > There's a tiny bit of weirdness with the tabs after the first > column, but it's way better than what I had. I definitely tried the > @\n, but I admit I was randomly typing at that point. The docs > could stand to be a bit clearer on newlines versus breaks. Perhaps > your print2d would make a good complementary tutorial to the > expression printer in the FAQ... > > Thanks, > Chris Have you read the special paragraph devoted to Format in the FAQ ? http://pauillac.inria.fr/caml/FAQ/format-eng.html It says somewhere: Practice When writing a pretty-printing routine, follow these simple rules: [...] 4.Don't try to force line breaking, let the pretty-printer do it for you: that's its only job. 5.End your main program by a print_newline () call, that flushes the pretty-printer tables (hence the ouput). (Note that the toplevel loop of the interactive system does it as well, just before a new input.) Best regards, 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