From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 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 C2ABABC69 for ; Fri, 23 Mar 2007 07:13:31 +0100 (CET) Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2N6DVRu029470 for ; Fri, 23 Mar 2007 07:13:31 +0100 Received: from compute1.internal (unknown [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 5C6C820C486 for ; Fri, 23 Mar 2007 02:13:27 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 23 Mar 2007 02:13:30 -0400 X-Sasl-enc: zaarPPcfxqN1wQxhYM/Mt5RjUF1TJEhg1Dw/R8SP3Awt 1174630410 Received: from adsl-75-18-118-97.dsl.sndg02.sbcglobal.net (adsl-75-18-118-97.dsl.sndg02.sbcglobal.net [75.18.118.97]) by mail.messagingengine.com (Postfix) with ESMTP id 67C87187A1 for ; Fri, 23 Mar 2007 02:13:30 -0400 (EDT) Date: Thu, 22 Mar 2007 23:13:23 -0700 (PDT) From: Martin Jambon X-X-Sender: martin@droopy To: caml-list@inria.fr Subject: Camlp4 3.10.0+beta: lists without $list:...$ Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at concorde with ID 4603700B.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ens-lyon:01 camlp:01 camlp:01 ctyp:01 ctyp:01 jambon:01 jambon:01 string:02 loc:03 lid:03 library:03 let:03 let:03 expressions:04 simpler:04 I managed to create an object type using camlp4orf: let ctyp_object _loc ml = let fields = List.fold_left (fun o (name, typ) -> let m = <:ctyp< $lid:name$ : $typ$ >> in <:ctyp< $o$; $m$ >>) <:ctyp< >> ml in <:ctyp< < $fields$ > >> where ml is a list of method declarations of type (string * ctyp) list. Before we just had to do this: <:ctyp< < $list:ml$ > >> Is there anything simpler than my solution? Is a shortcut available? If not, I think there should really be one. By the way, there should also be some shortcut for building list patterns and expressions without List.fold_*. A library could do that. Martin PS: any progress on the manual? It's kind of hard to test new features when you don't know what they are. -- Martin Jambon http://martin.jambon.free.fr