Hi
I’ve thrown in your version and used it within that big
app, a portion of which I’ve presented as an ‘example’ for
the syntax extension. Everything works well. I’ve also checked that the
compiler correctly points to locations of syntax errors (probably this was the
problem which forced me to move to camlp5). I will test it more.
Can I incorporate your contribution into the deliverable for
that extension?
Now that this tiny project grows, it’s probably worth
introducing a configure script with parameters like --without-interatei and --enable-camlp5.
Thank you!
Alexander
From: blue storm
[mailto:bluestorm.dylc@gmail.com]
Sent: Monday, January 25, 2010 2:32 PM
To: Alexander Voinov
Cc: Damien Doligez; caml-list@yquem.inria.fr
Subject: Re: [Caml-list] A syntax extension to simplify List
manipulation
On Mon, Jan 25, 2010 at 10:45 PM, Alexander Voinov <avoinov@gmail.com> 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.