caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Martin Jambon <martin_jambon@emailuser.net>
To: Hendrik Tews <tews@tcs.inf.tu-dresden.de>
Cc: Ocaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Camlp4 with traditional syntax (was: Camlp4 documentation)
Date: Fri, 18 Feb 2005 10:43:27 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0502181028370.1331-100000@localhost> (raw)
In-Reply-To: <rlhdk9q1pp.fsf_-_@ithif59.inf.tu-dresden.de>

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



  parent reply	other threads:[~2005-02-18 18:43 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-17 15:32 Immediate recursive functions Alex Baretta
2005-02-17 18:20 ` [Caml-list] " Marcin 'Qrczak' Kowalczyk
2005-02-17 19:00 ` Jason Hickey
2005-02-17 20:33   ` Alex Baretta
2005-02-17 19:18 ` Christian Szegedy
2005-02-17 20:36   ` Alex Baretta
2005-02-17 22:39   ` Camlp4 documentation (was: Immediate recursive functions) Martin Jambon
2005-02-17 23:30     ` [Caml-list] " Richard Jones
2005-02-17 23:51       ` Michael Walter
2005-02-18  0:51     ` Micha
2005-02-18  3:37       ` briand
2005-02-18  5:21     ` Oliver Bandel
2005-02-18  6:51     ` Johann Spies
2005-02-18  8:04     ` [Caml-list] Camlp4 documentation Alex Baretta
2005-02-18  8:54       ` Alex Cowie
2005-02-18 16:20         ` Camlp4 with traditional syntax (was: Camlp4 documentation) Hendrik Tews
2005-02-18 16:28           ` [Caml-list] " Alex Baretta
2005-02-18 22:36             ` Hendrik Tews
2005-02-21 12:28               ` Alex Baretta
2005-02-21 12:55                 ` Bardur Arantsson
2005-02-21 15:22                   ` [Caml-list] Camlp4 with traditional syntax Olivier Andrieu
2005-02-21 16:57                     ` Bardur Arantsson
2005-02-18 18:43           ` Martin Jambon [this message]
2005-02-18 22:41             ` [Caml-list] Camlp4 with traditional syntax (was: Camlp4 documentation) Hendrik Tews
2005-02-22 10:29           ` Oliver Bandel
2005-02-22 23:32             ` Richard Jones
2005-02-23  0:01             ` Martin Jambon
2005-02-24  0:47               ` Oliver Bandel
2005-02-24 15:24                 ` William D. Neumann
2005-02-18  8:14     ` [Caml-list] Camlp4 documentation (was: Immediate recursive functions) Robert M. Solovay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0502181028370.1331-100000@localhost \
    --to=martin_jambon@emailuser.net \
    --cc=caml-list@inria.fr \
    --cc=tews@tcs.inf.tu-dresden.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).