<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/01/ffa553f7b474e1e0d8832df3cc727cf6"
  from="Pietro Abate &lt;Pietro.Abate@a...&gt;"
  author="Pietro Abate"
  date="2003-01-07T03:59:05"
  subject="[Caml-list] type problem with camlp4"
  prev="2003/01/43e79a58009853705b48ca36fcab5c69"
  next="2003/01/8fb51787be19c5a51bde1b15e3640728"
  next-in-thread="2003/01/7fee1b5b613aa3d71ce448d60403241e"
  prev-thread="2003/01/43e79a58009853705b48ca36fcab5c69"
  next-thread="2003/01/8fb51787be19c5a51bde1b15e3640728"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] type problem with camlp4">
<msg 
  url="2003/01/ffa553f7b474e1e0d8832df3cc727cf6"
  from="Pietro Abate &lt;Pietro.Abate@a...&gt;"
  author="Pietro Abate"
  date="2003-01-07T03:59:05"
  subject="[Caml-list] type problem with camlp4">
<msg 
  url="2003/01/7fee1b5b613aa3d71ce448d60403241e"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2003-01-07T12:39:49"
  subject="Re: [Caml-list] type problem with camlp4">
<msg 
  url="2003/01/676a8e37ee6228f5e1705ee7a8ffabb0"
  from="Pietro Abate &lt;Pietro.Abate@a...&gt;"
  author="Pietro Abate"
  date="2003-01-07T22:36:50"
  subject="Re: [Caml-list] type problem with camlp4">
<msg 
  url="2003/01/87d5f328c77313794e409877b61422fb"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2003-01-08T02:31:37"
  subject="Re: [Caml-list] type problem with camlp4">
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
hi folks,

I have a problem expanding an &lt;:expr&lt;&gt;&gt; quotation.
the code snippet below raise this error
ocamlc -c -pp "camlp4o pa_extend.cmo q_MLast.cmo" -I
/usr/lib/ocaml/camlp4 test.ml
File "test.ml", line 19, characters 13-42:
This expression has type MLast.patt * ff but is here used with type
  MLast.patt * MLast.expr
  
how can I write the variable 'content' in the preprocessor step ?

It should be written down just like a string... is there any generic way 
to achive the same as I do with &lt;:expr&lt;$str:"ddd"&gt;&gt; for strings with any
datatype ?

Of course immagine that the variable 'a' came from a more complex
function like a parser...

tnx,
p

---------
(*pp camlp4o pa_extend.cmo q_MLast.cmo *)

open Pcaml;;

type ff = 
    | A1
    | A2

let el = Grammar.Entry.create gram "el";;
EXTEND
    expr:
        [[ "test"; n = LIST1 el SEP ";" -&gt;
            &lt;:expr&lt; let $list:n$ in 1 &gt;&gt;
        ]];
    el:
        [[ n = LIDENT -&gt;
            let a = A1 in  (* &lt;---- the problem is here!!! *)
            (&lt;:patt&lt;$lid:n$&gt;&gt;,&lt;:expr&lt;$a$&gt;&gt;) ]];
END

------
let a = test b ;;



-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

