From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 169BDBB81 for ; Thu, 12 Jan 2006 16:51:00 +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 k0CFoxFo025119 for ; Thu, 12 Jan 2006 16:50:59 +0100 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 QAA20709 for ; Thu, 12 Jan 2006 16:50:58 +0100 (MET) Received: from rwcrmhc12.comcast.net (rwcrmhc14.comcast.net [216.148.227.154]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k0CFovs8031794 for ; Thu, 12 Jan 2006 16:50:58 +0100 Received: from 192.168.1.100 (c-24-118-210-113.hsd1.mn.comcast.net[24.118.210.113]) by comcast.net (rwcrmhc14) with SMTP id <200601121550550140026k43e>; Thu, 12 Jan 2006 15:50:56 +0000 Subject: Re: [Caml-list] Request for comments: Printf list conversion From: Bill Wood To: Alessandro Baretta Cc: Ocaml In-Reply-To: <43C61F1F.4030101@barettadeit.com> References: <43C61F1F.4030101@barettadeit.com> Content-Type: text/plain Date: Thu, 12 Jan 2006 09:50:54 -0600 Message-Id: <1137081054.29722.13.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.0.1-1mdk Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 43C67AE3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43C67AE1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 printf:01 baretta:01 ocaml:01 hacked:01 hacked:01 wrote:01 hacks:01 prolog:01 recursively:01 pair:01 argument:01 alessandro:03 terribly:03 usability:04 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 On Thu, 2006-01-12 at 10:19 +0100, Alessandro Baretta wrote: . . . > What do you guys think about all this? Just a comment. I've been anticipating getting into something like this since I started considering OCaml as a work-horse language. I've gone through this exercise several times -- When I worked in Prolog, I hacked together a list formatter; after using Scheme a while I hacked out a list formatter package (and I'm dreading doing it yet again :-). The thing is, it's so terribly useful. I'm always inspired in my hacks by Common Lisp's (format...) form, which includes a ~{/~} pair containing conversion directives and that consumes a list argument. I don't want to appall you with complexity too soon, but when you think about this, consider the possibility that the list is a list of lists, each of which contains several items that are to be formatted using a a recursively specified (sub) format. This does enhance usability a great deal. I'm sure that there are people who will yelp in protest at this, but I do recommend looking at CL's format as at least one point in this design space. Good luck; I eagerly await your results :-) -- Bill Wood