Version française
Home     About     Download     Resources     Contact us    
Browse thread
Immediate recursive functions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Martin Jambon <martin_jambon@e...>
Subject: Re: [Caml-list] Camlp4 with traditional syntax (was: Camlp4 documentation)
On 18 Feb 2005, Hendrik Tews wrote:

> Alex Cowie <cowie@cs.unisa.edu.au> writes:
>
>    For me, the use of revised syntax has been a disincentive to using
>    Camlp4 metaprogramming.  I have always wondered whether a traditional
>    syntax version of Camlp4 was technically feasible.  Any comments?
>
> I believe it is possible. You can parse traditional ocaml (as
> opposed to the revised syntax) with camlp4, so it should be
> possible to write a quotation expander using traditional ocaml. I
> remember Daniel de Rauglaudre complaint a few times about the
> difficulty of parsing ocaml. So a quotation expander using
> traditional ocaml might have dark corners which do not look as
> elegant as pa_macro.ml.

There is (at least) one construct which is not provided by the regular
syntax (because it is totally useless when writing code by hand) but
which is essential:

  declare <list of str_items> end

This just packs several definitions (str_items) as one single
str_item.
This is extremely useful when replacing one definition written in an
extended syntax by several successive definitions (or zero) written in
OCaml.


Martin

--
Martin Jambon, PhD
Researcher in Structural Bioinformatics since the 20th Century
The Burnham Institute http://www.burnham.org
San Diego, California