English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
camlp4 and streams
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-05-13 (15:58)
From: Isaac Freeman <memotype@g...>
Subject: camlp4 and streams

I am having some problems using streams in my camlp4 extentions. The code:

  expr: LEVEL "expr1"
    [[ "yield"; e1 = expr LEVEL "simple";
       "continue"; e2 = expr LEVEL "simple" ->
          <:expr< [< $e1$; $e2$ >] >> ]];

produces the error:

isaac@lappy:~/stuff/ocaml$ ocamlc -pp "camlp4o pa_extend.cmo
q_MLast.cmo" -I +camlp4 -c gen-syntax.ml
File "gen-syntax.ml", line 8, characters 18-20:
While expanding quotation "expr":
Parse error: illegal begin of expression
Uncaught exception: Pcaml.Qerror("expr", 1, _)
Preprocessor error

However, when I change the stream into a list, it works fine, so I'm
sure there is just some technicality in using streams here that I'm
not accounting for properly. Any ideas?


James "Isaac" Freeman
memotype (at) gmail.com