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
problem with camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-07-02 (22:04)
From: Benedikt Grundmann <benedikt@c...>
Subject: problem with camlp4
Hi everybody,

I'm having a problem with a syntax extension I'm trying to write, the
smallest sample that I could come up with, that still shows the
problem is the following:

(*pp camlp4orf *)

open Camlp4.PreCast

let test _loc =
  let num = 0 in
  let acc = <:match_case<>> in
  <:match_case< true -> $expr:num$ | $acc$ >>
  <:match_case< true -> 0 | $acc$ >>

If I comment out the last line and instead enable the line above I get
this error:

ocamlc -c -pp "camlp4orf " -thread -g -I
File "", line 8, characters 23-25:
While expanding quotation "match_case" in a position of "expr":
  Parse error: "->" expected after [opt_when_expr] (in [match_case0])

I'm sure I missed something obvious... Please help.

Thanks a lot,


Calvin: I try to make everyone's day a little more

(From Calvin & Hobbes)