From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id BB488BC37 for ; Mon, 25 Jan 2010 23:32:50 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AukBAGOrXUvRVdnjkGdsb2JhbACRZIh/Zz8BAQEBCQkMBxMDrwiBQIRTiEQBAQMFhDQE X-IronPort-AV: E=Sophos;i="4.49,342,1262559600"; d="ml'?scan'208";a="54674604" Received: from mail-gx0-f227.google.com ([209.85.217.227]) by mail4-smtp-sop.national.inria.fr with ESMTP; 25 Jan 2010 23:32:13 +0100 Received: by gxk27 with SMTP id 27so3619329gxk.7 for ; Mon, 25 Jan 2010 14:32:12 -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=3K2LSEkf9bKVCdZ4NCF4l9Z6pP1OWX9agBBMOsQMU+I=; b=IxYXpiFTxHu38qXhK1W7Snpru0RC5I7bONXsypIS3mYQaUVKUGOqi3SYG/2WVez1zP 6w2XwCzRxK3q2MvvjYvbgIHSKjLTNQQE8yP9fjGYcXLEx7/Fwlej05Ls0Yz419aZ34zV C/QePJIpeIMkGivR/+exQCEr+DRNDIwHd+3Jg= 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=YGO7VRH0iJ8c1iT0rbgZWGmsBX00XeJsrumicDM+4qjM7JzU9s9E9GifvMp3NX2tyX yGY1MjWAthmQdxqC3zMOZ52SifuQ0aECzz24XH8eC8aBrNQ//zohXqJwEIJ0ol/GGwUJ 8atdj/GkC8VcGs+eBZC0KkzRecqP14c3pKoc8= MIME-Version: 1.0 Received: by 10.100.220.17 with SMTP id s17mr2941967ang.196.1264458731718; Mon, 25 Jan 2010 14:32:11 -0800 (PST) In-Reply-To: <005b01ca9e07$c254d6a0$46fe83e0$@com> References: <4b523e9c.0d67f10a.06ab.ffffced7@mx.google.com> <003801ca9702$a72e2b30$f58a8190$@com> <527cf6bc1001170024r1e74b0dal38c92924037f2788@mail.gmail.com> <005b01ca9e07$c254d6a0$46fe83e0$@com> Date: Mon, 25 Jan 2010 23:32:11 +0100 Message-ID: <527cf6bc1001251432n1e72c0b6idd26154e32cccfb9@mail.gmail.com> Subject: Re: [Caml-list] A syntax extension to simplify List manipulation From: blue storm To: Alexander Voinov Cc: Damien Doligez , caml-list@yquem.inria.fr Content-Type: multipart/mixed; boundary=00163623aa3589a2a4047e04bdf8 X-Spam: no; 0.00; syntax:01 voinov:01 uncomment:01 makefile:01 compiler:01 compile-time:01 makefile:01 command-line:01 runtime:01 camlp:01 command-line:01 camlp:01 tarball:01 voinov:01 zlib:01 X-Attachments: type="application/octet-stream" name="spbSyntax_camlp4.ml" name="spbSyntax_camlp4.ml" --00163623aa3589a2a4047e04bdf8 Content-Type: multipart/alternative; boundary=00163623aa3589a28f047e04bdf6 --00163623aa3589a28f047e04bdf6 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Jan 25, 2010 at 10:45 PM, Alexander Voinov wrote: > I've updated this extension to remove the dependency on ExtLib (as > suggested > previously). The price is that iteratei is not available with the core List > module. > > If you do need iteratei, first uncomment the > > # WITH_ITERATEI = 1 > > line in the Makefile (and do a fresh build), and, second, always > > open ExtLib;; > I think you should keep iteratei by default : if the user use an insufficient List module, he will get a classical "unbound value List.iteratei" error from the compiler, and will easily relate it to the code using your extension (as the "iteratei" name is apparent). If you document that point, it could be much easier than a compile-time option that requires one to edit the Makefile. If you really want an option to disallow iteratei syntaxically, you could use command-line options to make that choice at runtime (that would be more flexible). I don't know how well camlp5 handle command-line parameters, so I can't help you there. Regarding camlp4, I don't remember why this extension didn't work with it > after that big refactoring, which gave birth to camlp5. I'm making a TODO > for myself to take a look at this. > In case you're interested, attached is a short camlp4 (>= 3.10) port of your extension (wich wasn't thoroughly tested). As you can see, changes are minimal. This is just in case, I don't have any opinion on what preprocessor you should use. > The tarball is: http://www.voinov.org/FP/spbSyntax-1.0.1.tgz > > (and also http://www.voinov.org/FP/spbSyntax.tgz) > > PS : the software license is the zlib/png license. Maybe you should mention it explicitely. --00163623aa3589a28f047e04bdf6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Mon, Jan 25, 2010 at 10:45 PM, Alexander Voin= ov <avoinov@gmail= .com> wrote:
I've updated this extension to remove the dependency on ExtLib (as sugg= ested
previously). The price is that iteratei is not available with the core List=
module.

If you do need iteratei, first uncomment the

# WITH_ITERATEI =3D 1

line in the Makefile (and do a fresh build), and, second, always

open ExtLib;;

I think you should keep iteratei by = default : if the user use an insufficient List module, he will get a classi= cal "unbound value List.iteratei" error from the compiler, and wi= ll easily relate it to the code using your extension (as the "iteratei= " name is apparent).
If you document that point, it could be much easier than a compile-time opt= ion that requires one to edit the Makefile. If you really want an option to= disallow iteratei syntaxically, you could use command-line options to make= that choice at runtime (that would be more flexible).
I don't know how well camlp5 handle command-line parameters, so I can&#= 39;t help you there.


Regarding camlp4, I don't remember why this extension didn't work w= ith it
after that big refactoring, which gave birth to camlp5. I'm making a TO= DO
for myself to take a look at this.

In case you're interested, attached is a short camlp4 (>=3D 3.10= ) port of your extension (wich wasn't thoroughly tested). As you can se= e, changes are minimal. This is just in case, I don't have any opinion = on what preprocessor you should use.
=A0
The tarball is: http://www.voinov.org/FP/spbSyntax-1.0.1.tgz

(and also http://www.voinov.org/FP/spbSyntax.tgz)

=A0
PS : the software license is the zlib/p= ng license. Maybe you should mention it explicitely.
--00163623aa3589a28f047e04bdf6-- --00163623aa3589a2a4047e04bdf8 Content-Type: application/octet-stream; name="spbSyntax_camlp4.ml" Content-Disposition: attachment; filename="spbSyntax_camlp4.ml" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g4vu2j971 KCogV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