<?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/11/de3fb293ab7d64f03a57f202ae9fc467"
  from="William Lovas &lt;wlovas@s...&gt;"
  author="William Lovas"
  date="2003-11-03T21:11:27"
  subject="Re: [Caml-list] camlp4 in script"
  prev="2003/11/2be1dd0bb03dbb1d3a23a846c7e57647"
  next="2003/11/8163dd559883060e93e84dc62f5d126b"
  prev-in-thread="2003/11/2be1dd0bb03dbb1d3a23a846c7e57647"
  next-in-thread="2003/11/8163dd559883060e93e84dc62f5d126b"
  prev-thread="2003/11/96c5a045d70b126cf9ebbe6b346fc3dd"
  next-thread="2003/11/1d87c05e41bbe7ce253007f8039e67d7"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] camlp4 in script">
<msg 
  url="2003/11/ef8d11d2a3f4c6fd8183db8286734f46"
  from="Artem Prisyznuk &lt;tema@s...&gt;"
  author="Artem Prisyznuk"
  date="2003-11-03T15:05:39"
  subject="[Caml-list] camlp4 in script">
<msg 
  url="2003/11/2be1dd0bb03dbb1d3a23a846c7e57647"
  from="Issac Trotts &lt;ijtrotts@u...&gt;"
  author="Issac Trotts"
  date="2003-11-03T19:36:55"
  subject="Re: [Caml-list] camlp4 in script">
<msg 
  url="2003/11/de3fb293ab7d64f03a57f202ae9fc467"
  from="William Lovas &lt;wlovas@s...&gt;"
  author="William Lovas"
  date="2003-11-03T21:11:27"
  subject="Re: [Caml-list] camlp4 in script">
<msg 
  url="2003/11/8163dd559883060e93e84dc62f5d126b"
  from="Issac Trotts &lt;ijtrotts@u...&gt;"
  author="Issac Trotts"
  date="2003-11-04T00:52:03"
  subject="Re: [Caml-list] camlp4 in script">
</msg>
</msg>
</msg>
<msg 
  url="2003/11/4f6f0f0d0e94235cac264fe76793b7fc"
  from="Remi Vanicat &lt;vanicat@l...&gt;"
  author="Remi Vanicat"
  date="2003-11-04T09:16:32"
  subject="Re: [Caml-list] camlp4 in script">
<msg 
  url="2003/11/b332712b2d47a9c682bab732f273ca3b"
  from="Artem Prisyznuk &lt;tema@s...&gt;"
  author="Artem Prisyznuk"
  date="2003-11-04T09:45:54"
  subject="Re: [Caml-list] camlp4 in script">
<msg 
  url="2003/11/2c0eec700da6320a17bcd3d2469d1a05"
  from="Lars Nilsson &lt;lars@c...&gt;"
  author="Lars Nilsson"
  date="2003-11-04T14:58:08"
  subject="Re: [Caml-list] camlp4 in script">
<msg 
  url="2003/11/371fcb184f3608c4dffc91d3b3724c72"
  from="Issac Trotts &lt;ijtrotts@u...&gt;"
  author="Issac Trotts"
  date="2003-11-04T20:01:27"
  subject="Re: [Caml-list] camlp4 in script">
<msg 
  url="2003/11/591624a3bf7e87f6649a6d81577181bf"
  from="Issac Trotts &lt;ijtrotts@u...&gt;"
  author="Issac Trotts"
  date="2003-11-04T21:15:36"
  subject="Re: [Caml-list] camlp4 in script">
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/11/7c2a1cb12f95300a9f19c0db7c2ad6e0"
  from="Stefano Zacchiroli &lt;zack@b...&gt;"
  author="Stefano Zacchiroli"
  date="2003-11-05T08:24:38"
  subject="Re: [Caml-list] camlp4 in script">
</msg>
</msg>
</thread>

<contents>
On Mon, Nov 03, 2003 at 11:45:59AM -0800, Issac Trotts wrote:
&gt; ijtrotts@beech:/tmp$ cat c4.ml
&gt; let () =
&gt;     let includes = "-I /usr/lib/ocaml/camlp4" in
&gt;     let args =
&gt;         List.fold_left (^) "" (List.tl (Array.to_list Sys.argv))

I don't think this is what you want -- this will concatenate the arguments
without putting any whitespace between them.  Maybe:

    let args =
        String.concat " " (List.tl (Array.to_list Sys.argv))

&gt;     in
&gt;     let cmd =
&gt;         Printf.sprintf "ocaml %s camlp4r.cma %s" includes args
&gt;     in
&gt;     match Sys.command cmd with
&gt;       0 -&gt; ()
&gt;     | _ -&gt; prerr_endline ("Couldn't run "^cmd)
&gt;
&gt; [...]

cheers,
William

-------------------
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>

