Boost logo

Boost-Build :

Subject: Re: [Boost-build] [jam] named arguments for rule
From: aaron_at_[hidden]
Date: 2016-10-25 10:50:30


Just wanted to mention a way that we are currently simulating keyword arguments:
 
rule my-rule ( arg1 : arg2 : options * )
{
    local some-option = [ feature.get-values <some-option> : $(options) ] ;
    if some-value in $(some-option)
    {
        do-some-special-thing $(arg1) ;
    }
}
 
Which can then be called like so:
 
my-rule hello.cpp : hello.tr : <some-option>some-value <other-option>hello_world ;
 
It works really well as the build system supports it, however, I think it has a tendency
to confuse some developers as they are already confused about features/properties.
They tend to think the options passed are actually features/properties.
 
Aaron



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