Boost logo

Boost-Build :

From: Rene Rivera (grafik666_at_[hidden])
Date: 2002-07-02 12:02:10


[2002-07-02] Vladimir Prus wrote:

>Rene Rivera wrote:
>> [2002-07-02] Vladimir Prus wrote:
>> >Rene Rivera wrote:
>> >> 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.
>>
>> The closest you can get to that is:
>>
>> $(l0) = $($(l).self.value[1]) ;
>> ECHO $($(l0).self.value[1]) ;
>>
>> I think that will work. Maybe Dave has some better syntax up his sleeve
>> when it comes to class'es ;-)
>
>I'm thinking that we probably can wrap values in some class when putting it
>to container and unwrapping it when extracting.... ?

Hmmm... How about extending the "at" accessor to allow the dereferencing
directly like so:

ECHO [ $(l).at 0 : 1 ] ; # >> 2

That seems as simple a syntax, also looks like multi-dimensional arrays :-)

-- grafik - Don't Assume Anything
-- rrivera_at_[hidden] - grafik_at_[hidden]
-- 102708583_at_icq - Grafik666_at_AIM - Grafik_at_[hidden]

 


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