Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: rixed@happyleptic.org
To: caml-list@inria.fr
Subject: Re: [Caml-list] Format OCaml Code
Date: Fri, 23 Dec 2011 13:27:11 +0100	[thread overview]
Message-ID: <20111223122711.GB4433@ccellier.rd.securactive.lan> (raw)
In-Reply-To: <CAPFanBENrfvHh_qid07akjhm0KgSz4RAKCwwcGFhZvp08O2q2A@mail.gmail.com>

> Note that piping/redirection `camlp4o file.ml > foo` doesn't work as
> camlp4o sends a marshalled AST by default.

This is indeed annoying.
Unfortunately, and quite surprisingly to me, using -o /dev/stdout does
not help.

> An issue with camlp4 is that it can sometimes move comments a bit: the
> placement of comments in the reformatted source is approximative *with
> respect to whitespace* (you sometimes have a blank inserted between a
> phrase and the comment).

I've seen a comment in a record initialization (to comment on
a given field) moved far away, after the end of the record.
Here is an exemple :

---
type record = { a : int; b : int; c : int }
let r1 = {
	a = 0 ;
	b = 1 ; (* This is about b *)
	c = 2 }
---

where the comment disapear. While in this one :

---
type record = { a : int ; b : int ; c : int }
let r1 = {
        a = 0 ;
        b = 1 ; (* This is about b *)
        c = 2 } and
    r2 = { a = 0 ; b = 1 ; c = 2 }
---

the comment is moved after initialization of r1. :-(


  reply	other threads:[~2011-12-23 12:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-23  7:57 haihao shen
2011-12-23  8:04 ` Mihamina Rakotomandimby
2011-12-23  8:51   ` Gabriel Scherer
2011-12-23 12:27     ` rixed [this message]
2011-12-23 12:49       ` Jérémie Dimino
2011-12-23 17:01     ` Jérémie Dimino
2011-12-24  3:48   ` Francois¡¡Charles Matthieu¡¡Berenger
2011-12-24  8:35 ` Jun Furuse
2011-12-24  9:03   ` haihao shen

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=20111223122711.GB4433@ccellier.rd.securactive.lan \
    --to=rixed@happyleptic.org \
    --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