From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA15917; Mon, 3 Nov 2003 22:11:27 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA15623 for ; Mon, 3 Nov 2003 22:11:26 +0100 (MET) Received: from nexus.stwing.upenn.edu (NEXUS.STWING.UPENN.EDU [165.123.132.61]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hA3LBP107516 for ; Mon, 3 Nov 2003 22:11:25 +0100 (MET) Received: from force.stwing.upenn.edu (root@force.stwing.upenn.edu [165.123.132.65]) by nexus.stwing.upenn.edu (8.12.10/8.12.9) with ESMTP id hA3LBN9q009815 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 3 Nov 2003 16:11:24 -0500 (EST) Received: from force.stwing.upenn.edu (wlovas@localhost [127.0.0.1]) by force.stwing.upenn.edu (8.12.10/8.12.9) with ESMTP id hA3LBMWN020050 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 3 Nov 2003 16:11:23 -0500 (EST) Received: (from wlovas@localhost) by force.stwing.upenn.edu (8.12.10/8.12.9/Submit) id hA3LBM7d020048 for caml-list@inria.fr; Mon, 3 Nov 2003 16:11:22 -0500 (EST) Date: Mon, 3 Nov 2003 16:11:22 -0500 From: William Lovas To: caml-list@inria.fr Subject: Re: [Caml-list] camlp4 in script Message-ID: <20031103211121.GA19313@force.stwing.upenn.edu> Mail-Followup-To: caml-list@inria.fr References: <20031103194559.GB9184@ucdavis.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031103194559.GB9184@ucdavis.edu> User-Agent: Mutt/1.5.4i X-Loop: caml-list@inria.fr X-Spam: no; 0.00; lovas:01 wlovas:01 stwing:01 caml-list:01 camlp:01 issac:01 trotts:01 ijtrotts:01 usr:01 camlp:01 argv:01 argv:01 printf:01 sprintf:01 prerr:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, Nov 03, 2003 at 11:45:59AM -0800, Issac Trotts wrote: > ijtrotts@beech:/tmp$ cat c4.ml > let () = > let includes = "-I /usr/lib/ocaml/camlp4" in > let args = > 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)) > in > let cmd = > Printf.sprintf "ocaml %s camlp4r.cma %s" includes args > in > match Sys.command cmd with > 0 -> () > | _ -> prerr_endline ("Couldn't run "^cmd) > > [...] 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