From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id ABD2CBB9C for ; Thu, 17 Nov 2005 15:20:35 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jAHEKZM4008817 for ; Thu, 17 Nov 2005 15:20:35 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA18860 for ; Thu, 17 Nov 2005 15:20:34 +0100 (MET) Received: from mail.barettadeit.com (h213-255-109-130.albacom.net [213.255.109.130] (may be forged)) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jAHEKXss026963 for ; Thu, 17 Nov 2005 15:20:34 +0100 Received: from [10.0.0.10] (alex.barettalocal.com [10.0.0.10]) by mail.barettadeit.com (Postfix) with ESMTP id C4F889849 for ; Thu, 17 Nov 2005 15:26:02 +0100 (CET) Message-ID: <437C91B0.9030507@barettadeit.com> Date: Thu, 17 Nov 2005 15:20:32 +0100 From: Alessandro Baretta User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ocaml Subject: Camlp4 in a Unix pipe Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 437C91B3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 437C91B1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; baretta:01 baretta:01 barettadeit:01 camlp:01 camlp:01 preprocess:01 syntax:01 cmo:01 cmo:01 -impl:01 stdin:01 stdout:01 preprocess:01 stdout:01 unix:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 I'm musing a little with camlp4. Specifically, I'm trying to get it to preprocess input written according to some syntax extension and output the result. Of course, since I'm just playing, I'd like to do this in type-eval-loop kind of interface. I tried typing the following command in my shell: $ cat - | camlp4 pa_o.cmo pa_extend.cmo pr_o.cmo pa_openin.cmo Camlp4 dies miserably discarding it's standard input. So then I tried the following: cat - | camlp4 pa_o.cmo pa_extend.cmo pr_o.cmo pa_openin.cmo -impl /dev/stdin Again, camlp4 dies miserably with the following error message: I/O error: Illegal seek Short of writing my own Pr_stdout module, is there any way to achieve the result of interactively getting camlp4 to preprocess some code and print it back to stdout? Alex