From: "Olivier Andrieu" <oandrieu@gmail.com>
To: forum@x9c.fr
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] weird behavior with camlp4o
Date: Wed, 9 Apr 2008 09:36:40 +0200 [thread overview]
Message-ID: <95513600804090036m1bf04367w5736f67f3f37135b@mail.gmail.com> (raw)
In-Reply-To: <1207726165.47fc70555cb83@imp.ovh.net>
On Wed, Apr 9, 2008 at 9:29 AM, <forum@x9c.fr> wrote:
> Selon "Andrew I. Schein" <andrew@andrewschein.com>:
> > Greetings list -
> >
> > I was playing around with OCaml 3.10.2 camlp4o like this:
> >
> > camlp4o pa_breakcont.cmo sample1.ml
> >
> > with my macro pa_breakcont.cmo and got the expected macro translation
> > printed to my terminal. However, when I type:
> >
> > camlp4o pa_breakcont.cmo sample1.ml > out.ml
> >
> > out.ml contains binary output. Am I misusing camlp4o?
>
> I have encountered the same problem a few days ago while working on
> Ocaml-Java to make it camlp4-compatible.
>
> The fact is that the kind of output (binary dump of abstract tree or
> source code in textual form) is chosen according to the nature of the
> output file descriptor. If the output file descriptor denotes a tty
> then the textual form is chosen, otherwise the binary form is chosen.
>
> That being said, I don't know what is the rationale of this choice,
> as I have not come up with a use case for the binary form.
It's simply more efficient for ocamlc or ocamlopt when camlp4 is
called via the -pp option: no need to pretty-print and then reparse
the source.
--
Olivier
next prev parent reply other threads:[~2008-04-09 7:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-09 2:45 Andrew I. Schein
2008-04-09 7:29 ` [Caml-list] " forum
2008-04-09 7:36 ` Olivier Andrieu [this message]
2008-04-09 7:48 ` forum
2008-04-09 7:52 ` Nicolas Pouillard
2008-04-09 8:07 ` forum
2008-04-09 7:50 ` 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=95513600804090036m1bf04367w5736f67f3f37135b@mail.gmail.com \
--to=oandrieu@gmail.com \
--cc=caml-list@yquem.inria.fr \
--cc=forum@x9c.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