caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: "Sam Steingold" <sds@gnu.org>
Cc: "Nicolas barnier" <barnier@recherche.enac.fr>,
	"Caml list" <caml-list@inria.fr>
Subject: Re: [Caml-list] Re: Arg.spec and option types
Date: Thu, 22 Mar 2007 21:46:34 +0100	[thread overview]
Message-ID: <cd67f63a0703221346s5e580386vcb1d81d3f2b9219d@mail.gmail.com> (raw)
In-Reply-To: <4602E7F2.3060804@gnu.org>

On 3/22/07, Sam Steingold <sds@gnu.org> 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


      reply	other threads:[~2007-03-22 20:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-22 14:56 Nicolas barnier
2007-03-22 20:32 ` Sam Steingold
2007-03-22 20:46   ` Nicolas Pouillard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd67f63a0703221346s5e580386vcb1d81d3f2b9219d@mail.gmail.com \
    --to=nicolas.pouillard@gmail.com \
    --cc=barnier@recherche.enac.fr \
    --cc=caml-list@inria.fr \
    --cc=sds@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).