<?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/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"
  prev="2003/01/eb09f1ee07200707e0515c5acc1d81ba"
  next="2003/01/203d53f5ef719129cb2f7f8b230e4574"
  prev-in-thread="2003/01/7fee1b5b613aa3d71ce448d60403241e"
  next-in-thread="2003/01/87d5f328c77313794e409877b61422fb"
  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>
On Tue, Jan 07, 2003 at 01:39:47PM +0100, Daniel de Rauglaudre wrote:
&gt; In the syntax tree, they cannot appear as things of type "tt" since
&gt; Camlp4 cannot know all possible defined types. At this level, your
&gt; constructor is just "syntax tree of a constructor" and the constructor
&gt; name is just a string.

ok, I got the problem. The next question is: can I extract the string 
rappresenting a variable from a variable ?

in my example I would like to generate a piece of code with a datatype
(ff) that is the parsing result of the string n.

for example, if n = " a + b " I would like to generate a piece of code
like Add (a,b), where Add is part of the datastructure:
type ff =
    | A1
    | A2
    | Add of int * int

and this DS will be visible from both the program and the preprocessor.

el:
	[[ n = STRING -&gt;
		let node = magic_function ( parse_string n ) in
		let id = gen_id() in
		(&lt;:patt&lt;$lid:id$&gt;&gt;,&lt;:expr&lt;$node$&gt;&gt;)
	]];

who can I do that ? what is the magic function ?

tnx,
p
-------------------
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>

