caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: DooMeeR <d@doomeer.com>
To: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
Cc: OCaml List <caml-list@inria.fr>
Subject: Re: [Caml-list] ocamlbuild rule with recursive action
Date: Tue, 02 Dec 2008 12:27:05 +0100	[thread overview]
Message-ID: <49351B89.3080208@doomeer.com> (raw)
In-Reply-To: <34C5E0E0-6C71-40C2-8AC6-46B619710F32@erratique.ch>

Daniel Bünzli a écrit :
> Hello,
> 
> Is it possible to define a rule with an action that is performed 
> repeatedly until a condition is reached ?
> 
> Best,
> 
> Daniel

Well, you can define a rule like this :

rule ~prod: "%.rec" (fun env build ->
   let x = env "%2.rec" in (* a new fresh name *)
   if some condition then build x else Nop)

When your rule is executed, for exemple to produce "toto.rec", it will 
(if some condition) first produce "toto2.rec", which will produce 
"toto22.rec", and so on until some condition is false.

I didn't try it though.

-- 
Romain Bardou


  reply	other threads:[~2008-12-02 11:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02 10:40 Daniel Bünzli
2008-12-02 11:27 ` DooMeeR [this message]
2008-12-02 23:51   ` [Caml-list] " Daniel Bünzli
2008-12-03  9:44     ` Romain Bardou
2008-12-03  9:58       ` Daniel Bünzli

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=49351B89.3080208@doomeer.com \
    --to=d@doomeer.com \
    --cc=caml-list@inria.fr \
    --cc=daniel.buenzli@erratique.ch \
    /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).