From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 6756FBBAF for ; Tue, 23 Mar 2010 04:06:33 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuwCAPfMp0vRVdQ2kWdsb2JhbACbIQgVAQEBAQkLCgcTAx+8aYR9BA X-IronPort-AV: E=Sophos;i="4.51,292,1267398000"; d="scan'208";a="47607494" Received: from mail-vw0-f54.google.com ([209.85.212.54]) by mail2-smtp-roc.national.inria.fr with ESMTP; 23 Mar 2010 04:06:32 +0100 Received: by vws1 with SMTP id 1so613080vws.27 for ; Mon, 22 Mar 2010 20:06:32 -0700 (PDT) Received: by 10.220.3.230 with SMTP id 38mr424751vco.52.1269313592158; Mon, 22 Mar 2010 20:06:32 -0700 (PDT) Received: from [192.168.1.182] (pool-71-182-209-171.pitbpa.east.verizon.net [71.182.209.171]) by mx.google.com with ESMTPS id 33sm40178755vws.10.2010.03.22.20.06.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 22 Mar 2010 20:06:31 -0700 (PDT) Message-ID: <4BA83035.7060809@grant-olson.net> Date: Mon, 22 Mar 2010 23:06:29 -0400 From: Grant Olson Reply-To: kgo@grant-olson.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: Yoann Padioleau Cc: caml-list@inria.fr Subject: Re: [Caml-list] Building multiple configurations? References: <4BA80CB5.4080402@grant-olson.net> <4BA81A46.1030004@grant-olson.net> <6A0948D6-EBA8-4EAD-9684-DD8CDEFE0A1C@wanadoo.fr> In-Reply-To: <6A0948D6-EBA8-4EAD-9684-DD8CDEFE0A1C@wanadoo.fr> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; blablabla:01 stub:01 stub:01 runtime:01 config:01 config:01 wrote:01 caml-list:01 executables:01 boolean:01 breaks:02 parse:02 black:96 executable:03 executable:03 On 3/22/2010 9:56 PM, Yoann Padioleau wrote: > > Apparently it's a boolean since you support only 2 different configs ... > > > let config1 = { > field1 = 1; > field2 = true; > } > > let config2 = { > field1 = 2; > field2 = true; > } > > (* settable via command line or config file *) > let config = ref true > > let current_config () = > if !config then config1 else config2 > > ... > > let main = > let args = [ > "-config1", Arg.Set config, ""; > "-config2", Arg.Clear config ""; > ] > in > Arg.parse ... blablabla > > This is getting a off topic for this list, but it's a usability issue, not so much a technical one. Most users will be windows users who double-click on the icon to run it. I could create a batch file that calls the real .exe with the config switch to activate the alternate config, but is a user going to click on the pretty executable file with the custom icon, or the ugly batch file icon? I could create a stub executable to call the real one so I can get a pretty icon, but then people will wonder why the stub breaks when they copy it somewhere else and don't move the real executable. I could do some black magic and detect the executable name at runtime, and set the config based on that, but there's no reason someone shouldn't be able to hit F2 and rename the file. So I'd rather just have two stand-alone executables that contain everything they need.