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: | Martin Jambon <martin.jambon@e...> |
| Subject: | Re: [Caml-list] Ocaml compiler features |
On Mon, 15 Jan 2007, Nicolas Pouillard wrote: > On 1/14/07, Vincent Hanquez <tab@snarc.org> wrote: > > 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 Getting standard OCaml code doesn't guarantee that you can do something with it: in the case of syntax extensions, the result will be most likely unreadable. But the real problem is that there is no way of reverting back to the original source code. So if you write your programs in the revised syntax, all patches must be written in the revised syntax. Martin -- Martin Jambon http://martin.jambon.free.fr