Browse thread
Ocaml compiler features
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Nicolas Pouillard <nicolas.pouillard@g...> |
| Subject: | Re: [Caml-list] Ocaml compiler features |
On 1/14/07, Vincent Hanquez <tab@snarc.org> wrote: > On Sun, Jan 14, 2007 at 06:23:32PM +0000, Jon Harrop wrote: > > > > > If you're bored with > > > > > begin/end a good solution might be to define a new construct using > > > > > camlp4 instead of hacking the compiler. It's the good advice in > > > > > general for syntax problems. > > > > > > Writing things in camlp4 could help me, but won't improve the world of > > > ocaml. > > > > It will if you do something more productive with camlp4, like try...finally > > or ... > > and create lots of different syntax which make the code unsharable at > the end (each one using different syntaxes). > > I think camlp4 is the not the proper way to extends the language, and is > definitevely *NOT* going to improve the world of OCaml. > Although remind you that a property of camlp4 syntaxes is that you can trivially convert an input source in plain (indented) OCaml code. This is done using the Pr_o module, an OCaml pretty printer. Thus, you can share it. $ camlp4 some_strange_syntax.cmo pr_o.cmo foo.ml -o foo_ocaml.ml -- Nicolas Pouillard