caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christophe TROESTLER <Christophe.Troestler+ocaml@umons.ac.be>
To: yaoconglun@gmail.com
Cc: OCaml Mailing List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Re: How to achieve this camlp4 syntax extension
Date: Tue, 14 Apr 2009 02:24:31 +0200 (CEST)	[thread overview]
Message-ID: <20090414.022431.864180245398589194.Christophe.Troestler+ocaml@umons.ac.be> (raw)
In-Reply-To: <f7b50d2a0904021323o5cf327fwd808386e949efa5e@mail.gmail.com>

> On 4/2/2009 1:42 PM, Conglun Yao wrote:
>>
>> Different kinds of error happened, when trying to use it.
>>
>> Even the ordinary expression:  List.length [1; 2;3 ],  failed.  'List'
>> is parsed as module_longident, try to match the rule I defined.

Not sure whether you are still looking for a solution to this but, as
it was not possible to use theses constructions together with pa_do
(same grammar rule to modify), I added hooks so you can provide your
own functions for them.  E.g.,

val module_square_brackets : (module_longident -> Loc.t -> expr -> expr) ref

allows you to replace [M.[ e ]] by [!module_square_brackets m _loc e]
where [m] is the internal representation of [M] and [_loc] is the
location of the whole expression [M.[ e ]].

This is available in the last version of delimited overloading
(downloadable at http://pa-do.forge.ocamlcore.org/ ).

Hope it helps,
ChriS


      reply	other threads:[~2009-04-14  0:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-02 11:42 Conglun Yao
2009-04-02 12:33 ` [Caml-list] " Jérémie Dimino
2009-04-02 12:40 ` David Teller
2009-04-02 12:48   ` Conglun Yao
2009-04-02 13:00 ` Zheng Li
2009-04-02 20:23   ` Conglun Yao
2009-04-14  0:24     ` Christophe TROESTLER [this message]

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=20090414.022431.864180245398589194.Christophe.Troestler+ocaml@umons.ac.be \
    --to=christophe.troestler+ocaml@umons.ac.be \
    --cc=caml-list@yquem.inria.fr \
    --cc=yaoconglun@gmail.com \
    /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).