caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jonathan Protzenko <jonathan.protzenko@gmail.com>
To: Martin Jambon <martin.jambon@ens-lyon.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Pippo: a pretty interesting pre-processor that uses OCaml
Date: Tue, 03 Sep 2013 21:21:07 +0200	[thread overview]
Message-ID: <522636A3.6080609@gmail.com> (raw)
In-Reply-To: <5226364F.6050600@ens-lyon.org>

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
>> <http://caml.inria.fr/pub/ml-archives/caml-list/2009/03/7e9085b8601142024108e254df9dfb1e.en.html>.
>>
>> 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)
>>
>
>

      reply	other threads:[~2013-09-03 19:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 13:14 Jonathan Protzenko
2013-09-03 19:19 ` Martin Jambon
2013-09-03 19:21   ` Jonathan Protzenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=522636A3.6080609@gmail.com \
    --to=jonathan.protzenko@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=martin.jambon@ens-lyon.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).