Boost logo

Boost-Build :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2007-08-05 12:25:04


On 08/05/2007 10:09 AM, Rene Rivera wrote:
[snip]
>>> applying the following diff would solve the problem
>> (although I haven't actually tried it):
>
>> ! rule /rulename/ ( /param1/ : /param2/ : /.../ : /paramN/ ) {
>> /statements/ }
>
> Except the argument list definition is optional, so it's debatable
> whether to include it. But if we did, it would then make more contextual
> sense as:
>
> rule /rulename/ { /statements/ }
>
> or...
>
> rule /rulename/ ( /argument-list/ ) { /statements/ }
>
> And the same would apply to actions. At which point I start thinking a
> comment to the effect of "you can optionally define argument lists to
> rules and action (see below)." But you tell me which of the two makes
> sense as a reader, and I'll change it.
>

Since the actions syntax:

actions [ modifiers ] rulename { commands }

is already using square brackets to indicate optional,
then I'd be more in favor of:

rule /rulename/ [ ( /argument-list/ ) ]
   { /statements/ }

actions [ modifiers ] /rulename/ [ ( /argument-list/ ) ]
   { /statements/ }

*with* the comment constraining the rule and the corresponding
actions to either both have or both not have the optional
argument-list, [ ( /argument-list/ ) ]. Of course, now that
I look at it, it looks kinda cluttered, but maybe that's
the price that has to be paid for precision :(.

I'll have to think a little more on it.


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk