caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: Benedikt Grundmann <benedikt@cardexpert.net>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Question on camlp4 3.10
Date: Thu, 26 Jul 2007 16:04:35 +0200	[thread overview]
Message-ID: <1185458485-sup-4306@ausone.inria.fr> (raw)
In-Reply-To: <9b415f950707260657v6f2f92c6s84e2334f8c34e137@mail.gmail.com>

Excerpts from Benedikt Grundmann's message of Thu Jul 26 15:57:29 +0200 2007:
> Thanks,
> 
> But that gives me only the first part of my example.  What about the
> second one?  Is there an easy way to do that?
> 

Ah,  sorry  I didn't read the second part. It's a lot harder to have it correct
unless  you  completely ignore "open". You should do that with a Camlp4 filter,
that  store  the  module  path while traversing module declaration in a topdown
way.

> 
> 2007/7/26, Nicolas Pouillard <nicolas.pouillard@gmail.com>:
> > Look at the Camlp4MacroParser extension, there is __FILE__.
> >
> > Excerpts from Benedikt Grundmann's message of Thu Jul 26 15:46:26 +0200 2007:
> > > How can I get the name of the module where my syntax extension is
> > > applied?  For simplicity assume that I would like to write a MODULE
> > > macro similar to __FILE__ in c.
> > >
> > > shell> cat > test.ml
> > > let _ = print_endline MODULE
> > >
> > > shell> ./test
> > > Test
> > > shell> cat > test2.ml
> > > module M =
> > > struct
> > >   let _ = print_endline MODULE
> > > end
> > >
> > > shell> ./test2
> > > Test.M
> > >
> > >
> > > Cheers,
> > >
> > > Bene
> > >
> >
> > --
> > Nicolas Pouillard aka Ertai
> >
> 

-- 
Nicolas Pouillard aka Ertai


  parent reply	other threads:[~2007-07-26 14:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-26 13:46 Benedikt Grundmann
2007-07-26 13:50 ` [Caml-list] " Nicolas Pouillard
     [not found]   ` <9b415f950707260657v6f2f92c6s84e2334f8c34e137@mail.gmail.com>
2007-07-26 14:04     ` Nicolas Pouillard [this message]
2007-07-27 13:52       ` Benedikt Grundmann
2007-08-09 18:32         ` 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=1185458485-sup-4306@ausone.inria.fr \
    --to=nicolas.pouillard@gmail.com \
    --cc=benedikt@cardexpert.net \
    --cc=caml-list@inria.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;
as well as URLs for NNTP newsgroup(s).