From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=AWL,NO_REAL_NAME autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id ED500BBC1 for ; Wed, 9 Apr 2008 09:29:51 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsYAAGwN/EfVuiVno2dsb2JhbACQUnsBAQEBAQEHBQkHFppq X-IronPort-AV: E=Sophos;i="4.25,627,1199660400"; d="scan'208";a="11244856" Received: from 25.mail-out.ovh.net ([213.186.37.103]) by mail3-smtp-sop.national.inria.fr with SMTP; 09 Apr 2008 09:29:51 +0200 Received: (qmail 6885 invoked by uid 503); 9 Apr 2008 07:30:12 -0000 Received: (QMFILT: 1.0); 09 Apr 2008 07:30:12 -0000 Received: from b7.ovh.net (HELO mail237.ha.ovh.net) (213.186.33.57) by 25.mail-out.ovh.net with SMTP; 9 Apr 2008 07:30:12 -0000 Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 9 Apr 2008 07:29:25 -0000 Received: from adret2.inrialpes.fr (adret2.inrialpes.fr [194.199.23.100]) by imp.ovh.net (IMP) with HTTP for ; Wed, 09 Apr 2008 09:29:25 +0200 Message-ID: <1207726165.47fc70555cb83@imp.ovh.net> Date: Wed, 09 Apr 2008 09:29:25 +0200 From: forum@x9c.fr To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] weird behavior with camlp4o References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.6 X-Originating-IP: 194.199.23.100 X-Ovh-Tracer-Id: 8107605231270364126 X-Spam: no; 0.00; camlp:01 ocaml:01 camlp:01 cmo:01 cmo:01 denotes:01 abstract:01 caml-list:01 descriptor:02 descriptor:02 tree:02 binary:02 binary:02 output:02 output:02 Selon "Andrew I. Schein" : > 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. Hope this helps, Xavier Clerc