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
Strange output from Camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Hendrik Tews <tews@t...>
Subject: Re: [Caml-list] Strange output from Camlp4
Matt Gushee <> writes:

   I have a file,, whose contents look like this:
     let conf = object
       val mutable data:(string * string) list = []
       method get k = List.assoc k data
An immediate object, this is a bit more difficult. Note that the
quotation expander q_MLast contains no rules for immediate
objects. Further, and do not contain MLast.ExObj,
the ast constructor for immediate objects, so when pretty
printing an immediate object, you end up with this code:

      | e -> fun curr next _ k -> [: `not_impl "expr" e :] ]}];

   BTW, that is deliberately a let binding rather than a class definition.
   Is that not supposed to work?
I would say yes. You should submit a bug report about it.

To learn about the revised syntax you have to study the parser ... or read about what I have found out at

The translation to revised syntax of your example is as follows:

    value conf = object
      value mutable data: list (string * string) = [];
      method get k = List.assoc k data;

  Why do you need the revised syntax at all? If you just want to
  use quotations, you can use quotations in the original syntax,
  Version 0.2 does not have immediate objects, but I have done
  immediate objects already and I can release it if you need it. I
  plan to upgrade to 3.09 as soon as I find some time.

Feel free to ask more revised (syntax) questions!


Hendrik Tews