On Fri, Feb 9, 2018 at 7:07 AM, Fabien Chêne via Boost-build <boost-build@lists.boost.org> wrote:

I was wondering if it were possible to extend the bjam grammar so that:

rule lib ( name : sources * : requirements * )

can be called either (possibly using named arguments coming from the
rule definition):
lib foo : a.C b.C : requirements <define>XXX ;
lib foo : sources a.C b.C : requirements <define>XXX ;
lib foo : requirements <define>XXX : sources a.C b.C ;
lib sources a.C b.C : name foo : requirements <define>XXX ;

What do you think ?

IIRC we discussed this some long time ago.. You example usage is not "easy" to accomplish in a backward compatible way. The best alternative that I remember was having the argument names be a special format. For example:

lib foo : a.C b.C :requirements <define>XXX ;
lib foo :sources a.C b.C :requirements <define>XXX ;
lib foo :requirements <define>XXX :sources a.C b.C ;
lib :sources a.C b.C :name foo :requirements <define>XXX ;

That is having named arguments be ":<arg-name> arg .." (colon prefixed). Which would allow to distinguish them and the list value from all the other arguments. How does that sound to you?

--
-- Rene Rivera
-- Grafik - Don't Assume Anything
-- Robot Dreams - http://robot-dreams.net