From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id C7279BC69 for ; Thu, 22 Mar 2007 21:46:35 +0100 (CET) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2MKkZJ7008436 for ; Thu, 22 Mar 2007 21:46:35 +0100 Received: by ug-out-1314.google.com with SMTP id k3so781590ugf for ; Thu, 22 Mar 2007 13:46:35 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=DdMXOarBn2uXia7gcBfmNFnPoxomj+s3DccJq7tdvw6Oo4xF6glGmUw+ypqeu+waAdr7BF4ogY3TmG+YWBs/ngR+1wZUudztji0nBDQc5NRkuP8Cpqa2Otc71WcpF6pEc7wo9aVYsG/afyon216Z4nuP83stuk9ZNCu9zIctoCs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=RlEuATgz247JHDgsy6VbvPeb1PTj/PrjPR+mu4OtUh8wXeWRoFoRzLLdbe9OVZXw7yhKJvZXTTYPnIRGmLEw3YKt9pQ47uJdY7U6RKSrk3xSYEWCBYQB7R0I8yz9xjrdbeOrjHRtZaOgou0RNZsH+dgpNFAhdSF/hrl0v7EIZgA= Received: by 10.114.185.8 with SMTP id i8mr768801waf.1174596394255; Thu, 22 Mar 2007 13:46:34 -0700 (PDT) Received: by 10.114.183.4 with HTTP; Thu, 22 Mar 2007 13:46:34 -0700 (PDT) Message-ID: Date: Thu, 22 Mar 2007 21:46:34 +0100 From: "Nicolas Pouillard" To: "Sam Steingold" Subject: Re: [Caml-list] Re: Arg.spec and option types Cc: "Nicolas barnier" , "Caml list" In-Reply-To: <4602E7F2.3060804@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4602990B.6030406@recherche.enac.fr> <4602E7F2.3060804@gnu.org> X-j-chkmail-Score: MSGID : 4602EB2B.000 on concorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at concorde with ID 4602EB2B.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; barnier:01 constructors:01 initialized:01 foo:01 foo:01 wrote:01 wrote:01 workaround:01 behaviour:01 caml-list:01 int:01 int:01 string:02 string:02 arg:03 On 3/22/07, Sam Steingold wrote: > Nicolas barnier wrote: > > > > I think it would therefore be quite useful to add > > Set_option_{string|int|float} > > constructors which would expect {string|int|float} option ref values as > > arguments (usually initialized with None). Do others think the same or use > > some other workaround to obtain this behaviour ? > > It is nice to know that I am not the only one who is writing > Arg.String (fun s -> foo := Some s) > all the time. > > Sam. > What about, let opt_str r = Arg.String (fun s -> r := Some s);; ... opt_str foo ... That's what I use all the time. -- Nicolas Pouillard