|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-07-02 11:16:07
Rene Rivera wrote:
> [2002-07-02] Vladimir Prus wrote:
> >I want to write a rule which returns a pair of lists. Looking at
> >container.jam, it is not obvious how to do it. Rene, can you suggest
> >something -- now it looks like one cannot use ordinary jam lists as
>
> elements
>
> >of "list" class. I'd like to be able to:
> >
> > l = new list ;
> > $(l). push-back 1 2 3 4 5 ;
> > $(l).push-back 1 2 3 ;
>
> That should mostly work, but yes it will produce only one list, ( 1 2 3 4 5
> 1 2 3).
>
> What you want is this instead...
>
> l = [ new list ] ;
> $(l).push-back [ new list 1 2 3 4 5 ] ;
> $(l).push-back [ new list 1 2 3 ];
>
> Getting at subelements is bit tricky, but jam doesn't have an easy way :-(
>
> l0 = [ $(l).at 0 ] ;
> ECHO [ $(l0).at 0 ] ; # >> 1
Can we make this work without second level lists?
l0 = [ $(l).at 0 ] ;
ECHO $(l0[1]) ;
I'm quite happy with jam lists, and most rules now take jam lists. Second
level list is a little bit overkill for my task.
- Volodya
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