From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 8C376820A1 for ; Tue, 3 Sep 2013 21:19:51 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of martin.jambon@ens-lyon.org) identity=pra; client-ip=66.111.4.26; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="martin.jambon@ens-lyon.org"; x-sender="martin.jambon@ens-lyon.org"; x-conformance=sidf_compatible Received-SPF: Neutral (mail3-smtp-sop.national.inria.fr: domain of martin.jambon@ens-lyon.org does not assert whether or not 66.111.4.26 is permitted sender) identity=mailfrom; client-ip=66.111.4.26; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="martin.jambon@ens-lyon.org"; x-sender="martin.jambon@ens-lyon.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@out2-smtp.messagingengine.com) identity=helo; client-ip=66.111.4.26; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="martin.jambon@ens-lyon.org"; x-sender="postmaster@out2-smtp.messagingengine.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqEAAMU1JlJCbwQakWdsb2JhbABbgzyDeL1tgS4WDgEBAQEJCwsHFAQkgiQBAQUjBBEIOAEBDwsYAgIFFgsCAgkDAgECAUUGDQEHAQGHfgynG3SDXI1KBoEpjk0HgmmBNIk4j2+EfYYOiGw X-IPAS-Result: AqEAAMU1JlJCbwQakWdsb2JhbABbgzyDeL1tgS4WDgEBAQEJCwsHFAQkgiQBAQUjBBEIOAEBDwsYAgIFFgsCAgkDAgECAUUGDQEHAQGHfgynG3SDXI1KBoEpjk0HgmmBNIk4j2+EfYYOiGw X-IronPort-AV: E=Sophos;i="4.89,1016,1367964000"; d="scan'208";a="25610588" Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 03 Sep 2013 21:19:50 +0200 Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 00C83224F7; Tue, 3 Sep 2013 15:19:46 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Tue, 03 Sep 2013 15:19:47 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=bFe8NJgf4Pov7AFRbi5Rjv DsF/k=; b=pyVWkmDaEdcpWgjtHuAJF+O3UDm0tOHxDHOymF5VCgvImSEjL4DkEn j0tyBEPfs3hVLcX6k9etFsWYa8v2+JyQnt1RGs6gEFRHQYFlOfoHTWqVCI1qkZuS 1SKCZMmLvsNVUFO84E6b06NY5zSHJxW7Eg/wmYuJMfW+STACi8YEM= X-Sasl-enc: WfaimFAvci+bCkpWxGe+shayDRatjr7W0m4dkvHrWMb7 1378235985 Received: from [192.168.2.6] (unknown [50.193.45.145]) by mail.messagingengine.com (Postfix) with ESMTPA id D9007C00E84; Tue, 3 Sep 2013 15:19:44 -0400 (EDT) Message-ID: <5226364F.6050600@ens-lyon.org> Date: Tue, 03 Sep 2013 12:19:43 -0700 From: Martin Jambon User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-Version: 1.0 To: Jonathan Protzenko CC: caml-list@inria.fr References: <5225E0D0.70305@gmail.com> In-Reply-To: <5225E0D0.70305@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Pippo: a pretty interesting pre-processor that uses OCaml It looks a lot like camlmix :-) (http://mjambon.com/camlmix/) Martin On Tue 03 Sep 2013 06:14:56 AM PDT, Jonathan Protzenko wrote: > Hi, > > Following yesterday's discussion, and using that as a pretext for > writing my own tool, here's yet another pre-processor-sort-of. > > https://github.com/protz/pippo > > It requires OCaml 4.01.0rc1. The documentation for it is, of course, > pre-processed using Pippo. It is distributed with a Makefile that > allows you to recompile the documentation and thus play with the tool. > > It works as described in yesterday's thread: anything found between {% > and %} is fed to an OCaml interactive session. Therefore, the output of > the OCaml commands is interleaved with the non-OCaml parts of the file. > Basically, the tool allows you to script your documents easily. > > The tool also contains a special "inject_value" facility, that allows > you to make any OCaml value (constant, function) available in the > top-level session. For instance, running: > > inject_value > "__version" > "unit -> unit" > (fun () -> > print_endline "This is pippo v0.1"); > > will allow you to write, in the to-be-pre-processed document : > > {% > __version (); > %} > > For the record, the question (how do I use Toploop.setvalue) was asked > a few years ago but left unanswered > . > The OCaml maintainers should probably not look at the implementation, > by the way. > > Cheers, > > ~ jonathan > > PS: My warmest thanks go to Thomas Braibant for helping me find a name > with a pun (in French) >