From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id B42DE7EDE3 for ; Fri, 12 Oct 2012 19:55:09 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of wojciech.meyer@googlemail.com) identity=pra; client-ip=209.85.212.170; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="wojciech.meyer@googlemail.com"; x-sender="wojciech.meyer@googlemail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of wojciech.meyer@googlemail.com designates 209.85.212.170 as permitted sender) identity=mailfrom; client-ip=209.85.212.170; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="wojciech.meyer@googlemail.com"; x-sender="wojciech.meyer@googlemail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f170.google.com) identity=helo; client-ip=209.85.212.170; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="wojciech.meyer@googlemail.com"; x-sender="postmaster@mail-wi0-f170.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmICAONYeFDRVdSqjWdsb2JhbABFhUu6EAgjAQEBAQkJCwkSBiOCIAEBAQMBEgIsATgBAwELBgULFiUPAQQNEwEFASITIodPAQMJBgScGAkDjxyFAQpADYlOAQUMimCHIwOUGIFVgRWKDoMsP4QQ X-IronPort-AV: E=Sophos;i="4.80,577,1344204000"; d="scan'208";a="177024011" Received: from mail-wi0-f170.google.com ([209.85.212.170]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 12 Oct 2012 19:55:09 +0200 Received: by mail-wi0-f170.google.com with SMTP id hm2so56947wib.3 for ; Fri, 12 Oct 2012 10:55:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=DN6pdPHlpyhJq8HtwcnU+S5ugfJyHyaubzgVzPiUCMQ=; b=kJ/dRdN+zW7v5Qiwt6OXvfr+mkilEqCaMweKH8/KR2xtK2I+B7oqB2xDYan8pUesBs obGOu2HAxlLJwVpjmfEF/W9DatdLq1RR0H9qKCKm/Cs7Gz91DZN0NikMWPllMQMYaHWF k4ZfMuYbn5Znf8myGCi6LSuPN6oYljm56vpgwJJVHhgq7GuDqckoWktS08TrAgPM/idd VSL3IY1DXkwbzq+A+jxjgZaak4Em6qsJCzAECdcvavnC9Jadk35N3JFkQjiNXxVXu8hW fP8n+abkehKTHmSOwX8jQNOIyh3auLHn1jq2MoKFilMdyJfSxg8ACEgkIgdUnc75M9aH ANzA== Received: by 10.180.95.130 with SMTP id dk2mr7692536wib.18.1350064508734; Fri, 12 Oct 2012 10:55:08 -0700 (PDT) Received: from spec-desktop.danmey.org (cpc1-cmbg12-0-0-cust201.5-4.cable.virginmedia.com. [86.9.116.202]) by mx.google.com with ESMTPS id ay10sm4880241wib.2.2012.10.12.10.55.07 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Oct 2012 10:55:08 -0700 (PDT) From: Wojciech Meyer To: Mike McClurg Cc: caml-list@inria.fr References: Date: Fri, 12 Oct 2012 18:55:07 +0100 In-Reply-To: (Mike McClurg's message of "Fri, 12 Oct 2012 18:36:40 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Caml-list] Generating a module implementation from a module signature using camlp4 Hi Mike, Mike McClurg writes: > It seems that I would want to use a camlp4 filter to do this, but as > far as I can tell it's not possible to create a filter from sig_items > to str_items. Is a filter the right approach? Am I going to have to > define my module signatures as module type definitions from within ml > files? Can anyone give me some some advice on how to do this properly? You can explicitly pretty print the camlp4 quotations: open Camlp4 open Camlp4.PreCast let _loc = Loc.ghost let foo nm = <:str_item> module OCamlPrinter = Camlp4.PreCast.Printers.OCaml;; OCamlPrinter.print_implem (foo "OK") == Then you need some ocamlbuild plugin to create a rule that pipes to a file. -- Wojciech Meyer http://danmey.org