caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* OCaml IDE (Camlp4 for code formatting)
@ 2005-06-20 20:08 Nathaniel J. Gaylinn
  2005-06-21 10:33 ` [Caml-list] " Hendrik Tews
  0 siblings, 1 reply; 7+ messages in thread
From: Nathaniel J. Gaylinn @ 2005-06-20 20:08 UTC (permalink / raw)
  To: caml-list


One feature I want my program to have is autoformatting, that is, the
ability to go through and indent source code for you in some standard way.
At first glance, OCamlp4 seemed like the way to go for this, but under
further inspection I'm not sure this is true.

My main problem with OCamlp4 is that it changes the input source code!
Expressions like "5;;" that are just used for side effect are replaced
with "let _ = 5;;" which is equivalent, but different code. I understand
why it makes this change, but since my program is intended for students
the last thing I want is for it to change their code, even in a trivial
way such as this. Also, I'm pretty sure I've observed OCamlp4 eating
comments, which obviously is no good.

Is there a nice way to get OCamlp4 not to change the source code it's
given in any way except for spacing? Is there some other convenient way to
autoformat OCaml source? Is there a documented standard of what properly
formatted OCaml code should look like? It's hard to derive a set of
indentation rules just from anecdotal code snippets.

On a similar note, is there any reference to the format in which Camlp4
outputs its syntax tree? I might be able to use the syntax tree for
formatting and other purposes in my ide, but I can't at all read the
binary format it spits out. Is this something easy to read, or is it only
meant to be accessed by OCaml itself?

Thanks,

  -- Nate Gaylinn


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-06-29 16:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-20 20:08 OCaml IDE (Camlp4 for code formatting) Nathaniel J. Gaylinn
2005-06-21 10:33 ` [Caml-list] " Hendrik Tews
2005-06-21 13:47   ` Nathaniel J. Gaylinn
2005-06-21 15:18     ` Hendrik Tews
2005-06-21 18:11       ` David Brown
2005-06-29 14:54         ` [Caml-list] Keyboard interrupt in Windows Nathaniel J. Gaylinn
2005-06-29 16:13           ` Christopher A. Watford

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).