caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: ben kuin <benkuin@gmail.com>
To: caml-list@inria.fr
Subject: what do I need to know to understand camlp4
Date: Thu, 23 Sep 2010 16:56:03 +0200	[thread overview]
Message-ID: <AANLkTimDGTYzqsQzEvQO4rgR-128q35VZKD4gk5n1LH+@mail.gmail.com> (raw)

hi
I'm a Ocaml n00b (without any degree). Therefore I have a faible for
everything that makes Ocamls syntax more algol/imperative like [1]. An
example would be an extension like 'newref'
(http://bitbucket.org/johannes/newref/wiki/Home), which turns:

    print_int !i       into       print_int $i    (* newref *)

so I fiercely try to also perlify the declaration that turns

     let i = ref 3     into        let $i = 3     (* my idea ... *)

but camlp4 makes my head spin. The syntax is very difficult and in a
lot of camlp4 documentation there is AST modification involved, which
is a subject I don't get although I made several attempts. And simple
program transformation with camlp4 (using concrete syntax) is nowhere
documented.

Could someone give any idea how I can begin to understand how to write
simple camlp4 extensions?

thanks
ben

[1] please don't kill me


             reply	other threads:[~2010-09-23 14:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-23 14:56 ben kuin [this message]
2010-09-23 15:21 ` [Caml-list] " David MENTRE
2010-09-23 19:50   ` ben kuin
2010-09-24  0:15     ` Elias Gabriel Amaral da Silva
2010-09-24  7:35       ` David House
2010-09-27 11:43         ` Elias Gabriel Amaral da Silva
2010-09-24  7:48     ` David MENTRE
2010-09-23 15:25 ` bluestorm
2010-09-23 16:23   ` Jake Donham
2010-09-23 18:49     ` ben kuin
2010-09-23 18:54       ` Jake Donham
2010-09-23 19:06       ` Yoann Padioleau
2010-09-23 16:28 ` Michael Ekstrand
2010-09-23 16:35 ` Sylvain Le Gall
     [not found] ` <1285259219.1820.15.camel@knine>
2010-09-23 18:43   ` [Caml-list] " ben kuin

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=AANLkTimDGTYzqsQzEvQO4rgR-128q35VZKD4gk5n1LH+@mail.gmail.com \
    --to=benkuin@gmail.com \
    --cc=caml-list@inria.fr \
    /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).