Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Camlp4: syntax extension in source file
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-10-25 (09:39)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] Camlp4: syntax extension in source file

On Fri, Oct 25, 2002 at 12:33:48AM +0200, Alain Frisch wrote:
> This thread about macro definition with Camlp4 reminds me of an idea I had
> some time ago. The idea is to use the Toplevel lib to introduce Caml
> syntax extension directly inside source file.

Introducing the equivalent of "eval"? This is an old idea, indeed.

For the moment, loading the OCaml toplevel does not work:
     $ camlp4r -I `ocamlc -where` toplevellib.cma
     Error while loading "lib/ocaml/toplevellib.cma":
       no implementation available for Outcometree

It is because of the module Dynlink which is too severe for interfaces
not having implementations.

Too severe, probably, and anyway more severe than the linker. Compare
the functions "check_consistency" of:

   1/ otherlibs/dynlink/ and
   2/ bytecomp/

In the case "Not_found", Dynlink refuses while Bytelink accepts.
Changing this case in the Dynlink module make the loading work.

The next step is to know if it is possible to extract a good "eval"
function from the modules Toploop or Topdir. I am not sure.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: