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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 9564E820A1 for ; Tue, 3 Sep 2013 21:21:10 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jonathan.protzenko@gmail.com) identity=pra; client-ip=74.125.82.170; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jonathan.protzenko@gmail.com"; x-sender="jonathan.protzenko@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of jonathan.protzenko@gmail.com designates 74.125.82.170 as permitted sender) identity=mailfrom; client-ip=74.125.82.170; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jonathan.protzenko@gmail.com"; x-sender="jonathan.protzenko@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-we0-f170.google.com) identity=helo; client-ip=74.125.82.170; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jonathan.protzenko@gmail.com"; x-sender="postmaster@mail-we0-f170.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq0BAMU1JlJKfVKqk2dsb2JhbABbgmZWg3i9bYEuFg4BAQEBBwsLCRQEJIIkAQEFIwQZARscAQEDDAYFCw0CAgUWCwICCQMCAQIBEREBBQEcBg0BBwEBh2sBAw8BC5wQi39RgwWEKgoZJw1kh2sBBQyBHY5NB4JpgTQDl3WBL4sLg0NBhEo X-IPAS-Result: Aq0BAMU1JlJKfVKqk2dsb2JhbABbgmZWg3i9bYEuFg4BAQEBBwsLCRQEJIIkAQEFIwQZARscAQEDDAYFCw0CAgUWCwICCQMCAQIBEREBBQEcBg0BBwEBh2sBAw8BC5wQi39RgwWEKgoZJw1kh2sBBQyBHY5NB4JpgTQDl3WBL4sLg0NBhEo X-IronPort-AV: E=Sophos;i="4.89,1016,1367964000"; d="scan'208";a="31372123" Received: from mail-we0-f170.google.com ([74.125.82.170]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 03 Sep 2013 21:21:09 +0200 Received: by mail-we0-f170.google.com with SMTP id w60so5946287wes.29 for ; Tue, 03 Sep 2013 12:21:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=0mjpuaHRtW/z33I3XRkC3YZ6jRHtFjoeptaEmv0nTaM=; b=wi4lo7npOEjtw5Rrb8fn5YbI9ZWkhO1yAQxQH65//uIG5Bxw4lPojfLn3cIem9IImX sfv8juEW6ZLaSYbNYr2UPum0Qz38xuxtHGcTEOhg8PChvUiYmXsOlH5qL2b4tNU+/Dz/ sAmbK6gdsSA89DxmifaYUzMm9cVuQUVt5FlQ/t+XCtC9+HN2+eWKzMRi+E9XaJbRbGLf w0DBMhnt7zOClMJc383z+ebSn1pu6rek4HK7RLoKwzr9ak1b+KhbqQvtJSAVa7kt1M7M UtVzr+qWQL2ePVNJz+3viC+C19fgy2v9i2aT7j0VYJlxEQaEjf5hfB3pb2ejhbg2n+ZU JKnw== X-Received: by 10.180.77.68 with SMTP id q4mr8378262wiw.4.1378236069977; Tue, 03 Sep 2013 12:21:09 -0700 (PDT) Received: from ?IPv6:2a01:e35:2f37:f210:5e26:aff:fe0c:c1d8? ([2a01:e35:2f37:f210:5e26:aff:fe0c:c1d8]) by mx.google.com with ESMTPSA id jf2sm27624920wic.2.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Sep 2013 12:21:09 -0700 (PDT) Message-ID: <522636A3.6080609@gmail.com> Date: Tue, 03 Sep 2013 21:21:07 +0200 From: Jonathan Protzenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Thunderbird/26.0a1 MIME-Version: 1.0 To: Martin Jambon CC: caml-list@inria.fr References: <5225E0D0.70305@gmail.com> <5226364F.6050600@ens-lyon.org> In-Reply-To: <5226364F.6050600@ens-lyon.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Pippo: a pretty interesting pre-processor that uses OCaml Huh. I wish I'd found that earlier :-). At least I had fun writing it! ~ jonathan On Tue 03 Sep 2013 09:19:43 PM CEST, Martin Jambon wrote: > 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) >> > >