From: Julien Moutinho <julien.moutinho@gmail.com>
To: Gabriel Kerneis <gabriel.kerneis@enst.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] [Camlp4][trivial ?] Anonymous bind (for monads)
Date: Tue, 31 Jul 2007 19:50:15 +0200 [thread overview]
Message-ID: <20070731175015.GA10482@jiyu.gnu> (raw)
In-Reply-To: <E1IFv09-00041N-5v@kerneis.info>
On Tue, Jul 31, 2007 at 06:55:05PM +0200, Gabriel Kerneis wrote:
> EXTEND Gram
> expr: LEVEL "top"
> [[ t=expr; "foo"; f=expr ->
> <:expr<
> Lwt.bind $t$ (fun () -> $f$)
> >>]];
> END
> end
> [...]
> But if I change "foo" to ">>" (which is the usual way to write an
> anonymous bind for monads), it doesn't work anymore. I first thought the
> reason was that ">>" is also the symbol for closing a quotation, but
> trying "++" instead proved useless as well.
>
> I'm certainly not a camlp4 guru so... what am I missing?
My guess is that the first [t=expr] swallows the ">>".
You can try "->" or "|" against which [expr] does not match,
but I think it is not advisable to use them in a bigger program.
However, I'm sure that Mr.Pouillard will be happy to enlight us on how to use ">>".
HTH a little.
next prev parent reply other threads:[~2007-07-31 17:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-31 16:55 Gabriel Kerneis
2007-07-31 17:02 ` [Caml-list] " Gabriel Kerneis
2007-07-31 17:50 ` Julien Moutinho [this message]
2007-08-09 18:29 ` Nicolas Pouillard
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=20070731175015.GA10482@jiyu.gnu \
--to=julien.moutinho@gmail.com \
--cc=caml-list@inria.fr \
--cc=gabriel.kerneis@enst.fr \
/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