From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 3121ABBAF for ; Sun, 17 Jan 2010 09:24:15 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkYCAHdXUkvRVdPGkGdsb2JhbACRaolaPwEBAQEJCQwHEwOrMYEyhB6GUAECAwWELQQ X-IronPort-AV: E=Sophos;i="4.49,291,1262559600"; d="scan'208";a="41601255" Received: from mail-yw0-f198.google.com ([209.85.211.198]) by mail2-smtp-roc.national.inria.fr with ESMTP; 17 Jan 2010 09:24:14 +0100 Received: by ywh36 with SMTP id 36so1748053ywh.15 for ; Sun, 17 Jan 2010 00:24:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=5SCq0hqonJdHWnDDABPvRKwxukPVC9wG3FUjHo6wW6I=; b=mlyVkeyLu4gGbth8i98bDJt6Z/4RizHe/FSRZRQQtQFeWZ25b4lRCMgPkgSZMEM/kW fenO3iG67LmMv9tqgZJT0+cL1YaBcj07wN36GtltmJUvllppp/uTjsDuFBCdeECeeRZ8 6mJzdlVux/kGCUxkCmSg2i2P6LuIWuY8ZhKUM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=OSFnTDKv2TXQ6z1u2l/5Hl+D2P95VEbxUKcVkUw/iEv6WgyWIb3XQafIqPO1AA3cVw C1Mm8F+QAh0lP5NyXx5W7D/qF3qZtYnoUiKG/gJUQRUAe9nZXXFl7LmZpsKfNeSteNv+ aZ0crp+frklmC99Duc8ZAQNRRXW8wAA19rpew= MIME-Version: 1.0 Received: by 10.100.220.6 with SMTP id s6mr7303729ang.140.1263716650815; Sun, 17 Jan 2010 00:24:10 -0800 (PST) In-Reply-To: <003801ca9702$a72e2b30$f58a8190$@com> References: <4b523e9c.0d67f10a.06ab.ffffced7@mx.google.com> <003801ca9702$a72e2b30$f58a8190$@com> Date: Sun, 17 Jan 2010 09:24:10 +0100 Message-ID: <527cf6bc1001170024r1e74b0dal38c92924037f2788@mail.gmail.com> Subject: Re: [Caml-list] A syntax extension to simplify List manipulation From: blue storm To: Alexander Voinov Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; syntax:01 syntax:01 camlp:01 stdlib:01 lexeme:01 parametrize:01 storm:98 git:98 git:98 caml-list:01 expression:02 match:02 construct:02 external:03 override:03 Thanks for the release : it's interesting to see syntax extensions in use. I have a few question/remarks. 1) Are you interested in a camlp4 (>= 3.10) port ? 2) The use of the Extlib module is hardcoded in the syntax extension. I would find it nicer if you only referred to "List.map" instead of "Extlib.List.map", and let the user "open Extlib" if he wants to override the stdlib. That would allow one to use other implementations of List. You could also add an option to use "List.map" instead of "Extlib.List.map", if you want Extlib to be the default. 3) iterate/iteratei use a closing "done" lexeme. I understand that it was nicer for use in a ;-sequence, but doesn't it somehow break the homogeneity with the "match .. with" construct ? 4) It could be interesting to parametrize the syntax extension of the precise collection module used. In my own pa_comprehension [1] extension, i use "Module : expression" (in you setting that would be something like "map Array : e with ...") for that purpose. You could instead choose to make the used module implicit (expand to "map" instead of "List.map" or "Extlib.List.map"), and let an external openin-like facility do the job. As I understand an open_in syntax is going to be included in the mainstream for 3.12, that's probably the best solution. [1] http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=batteries/batteries.git;a=blob;f=src/syntax/pa_comprehension/README;h=e17aa35b72a54d7db28c5f8b8dcb19ed40df1b68;hb=HEAD