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 BAA23869; Tue, 4 Nov 2003 01:52:03 +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 BAA23842 for ; Tue, 4 Nov 2003 01:52:00 +0100 (MET) Received: from pop9.ucdavis.edu (pop9.ucdavis.edu [169.237.105.19]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hA40pu116387 for ; Tue, 4 Nov 2003 01:51:57 +0100 (MET) Received: from beech (beech.ucdavis.edu [128.120.141.134]) by pop9.ucdavis.edu (8.12.9/8.12.9/it-std-5.0.2) with ESMTP id hA40psEV029821; Mon, 3 Nov 2003 16:51:54 -0800 (PST) Received: from ijtrotts by beech with local (Exim 3.36 #1 (Debian)) id 1AGpZA-00038w-00; Mon, 03 Nov 2003 17:01:04 -0800 Date: Mon, 3 Nov 2003 17:01:04 -0800 From: Issac Trotts To: William Lovas Cc: caml-list@inria.fr Subject: Re: [Caml-list] camlp4 in script Message-ID: <20031104010104.GA10990@ucdavis.edu> Reply-To: ijtrotts@ucdavis.edu References: <20031103194559.GB9184@ucdavis.edu> <20031103211121.GA19313@force.stwing.upenn.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031103211121.GA19313@force.stwing.upenn.edu> User-Agent: Mutt/1.5.4i X-Loop: caml-list@inria.fr X-Spam: no; 0.00; issac:01 trotts:01 ijtrotts:01 caml-list:01 camlp:01 lovas:01 issac:01 trotts:01 ijtrotts:01 usr:01 camlp:01 argv:01 argv:01 printf:01 sprintf:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, Nov 03, 2003 at 04:11:22PM -0500, William Lovas wrote: > 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) > > > > [...] You're right. Thanks for catching it. Issac -- ------------------- 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