caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Martin Jambon <martin1977@laposte.net>
To: Alain Frisch <Alain.Frisch@inria.fr>
Cc: "Martin Jambon" <martin1977@laposte.net>,
	"Bünzli Daniel" <daniel.buenzli@epfl.ch>,
	"Eric Breck" <ebreck@cs.cornell.edu>,
	caml-list@inria.fr
Subject: Re: Camlp4 mysteries (was Re: On language extensions (was Re: [Caml-list] global record))
Date: Thu, 20 Jul 2006 17:11:11 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0607201640550.28576@localhost> (raw)
In-Reply-To: <44C013EC.2080201@inria.fr>

On Fri, 21 Jul 2006, Alain Frisch wrote:

> Martin Jambon wrote:
>> Otherwise it's possible to define well-disciplined syntax extensions.
>> For example, if each new syntax construct (new rule) is forced to start
>> with a unique, registered keyword and end with "end", then different
>> syntax extensions that follow this rule should play well together.
>
> Except that any new keyword can potentially break existing code. You'd
> need some other syntactical convention.

Sure, but for future code which uses future syntax extensions, it will be 
OK.

For the current extensions, it is possible to offer alternatives (via a 
-std option or something like that). If I understand correctly, we will have to 
adapt quite a few things for our syntax extensions to support the new 
Camlp4, so while we are at it, adding an alternate standardized syntax 
won't be a problem if it doesn't require too much thinking.

(In addition to that, like Skaller suggested, something like "open syntax 
Mysyntax" would make syntax extensions available like library modules, 
which simplifies makefiles and doesn't force every module to use them. But 
that's about integrating Camlp4 tightly in the OCaml language, which is 
another story)


>> It would be really nice to have official guidelines on how to develop
>> clean syntax extensions, if not automatic enforcement.
>
> Do you have concrete examples of extensions that don't play well together?

Yes, mine :-)

In micmatch I delete and redefine the constructs with bindings: let, let 
in, match, try, function.

The resulting syntax gives the illusion of a nice integration, but this 
is a redefinition of the existing constructs, so if another extension 
does the same, only the one which is loaded last will be usable.

In practice I haven't had any problem like that, but it's a 
possibility.
So this is why someone should decide of a standard, and we will follow it.


Martin

--
Martin Jambon, PhD
http://martin.jambon.free.fr


  reply	other threads:[~2006-07-21  0:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-20  1:12 On language extensions (was Re: [Caml-list] global record) Eric Breck
2006-07-20  5:16 ` skaller
2006-07-20  6:29   ` Stefano Zacchiroli
2006-07-20  8:57     ` Jean-Marie Gaillourdet
2006-07-20 12:42 ` Bünzli Daniel
2006-07-20 12:40   ` Camlp4 mysteries (was Re: On language extensions (was Re: [Caml-list] global record)) Martin Jambon
2006-07-20 23:38     ` Alain Frisch
2006-07-21  0:11       ` Martin Jambon [this message]
2006-07-21  0:29       ` skaller
2006-07-21  0:31       ` Martin Jambon

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.64.0607201640550.28576@localhost \
    --to=martin1977@laposte.net \
    --cc=Alain.Frisch@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=daniel.buenzli@epfl.ch \
    --cc=ebreck@cs.cornell.edu \
    /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).