Boost logo

Boost-Build :

From: Rene Rivera (grafik666_at_[hidden])
Date: 2002-07-03 10:13:56


[2002-07-03] Vladimir Prus wrote:

>Rene Rivera wrote:
>
>> >One other thought if that doesn't seem apporpriate for what you need...
to
>> >do the unwrapping I'd add another accessor like this:
>> >
>> >l0 = [ $(l).get-at 0 ] ;
>> >ECHO $(l0[1]) ;
>> >
>> >A better name than "get-at" would be good though.
>>
>> OK, both are implemented and tested now :-)
>>
>> Couldn't think of a better name than get-at.
>
>Oh... that's "get-at" I was interested in. Now, in function returing two
>lists I'd write
>
> return [ new list [ new list $(l1) ] [ new list $(l2) ] ;
>
>and at call site:
>
> t = [ some-rule ] ;
> x1 = [ $(t).get-at 0 ] ;
> for e in $(x1) ....
>
>Great! This is certainly better than separating the two lists with "@" and
>manually unpacking them.
>
>I've have two nits, though. You better document that the 'list' class uses
>1-based numbering ("mimics std::list" made me though differently), and
>document the new 'get-at' method, as well as 'at', now that is accepts
>several indices.

The whole file needs documentation ;-) I'll add it in the next set of
changes.

>BTW, I'm really thinking that $(l[0]) should result in error. Jam's
checking
>for errors in variable expansion is rather sloppy.

I thought it did :-\ Which is whyI don't check for that sort of "error".

>I'm also not sure about the name "list". It causes confusion with jam's
>lists. Can we use a different name, something like "tuple", or "vector"?

"vector" seems like a better fitting name the "tuple". Dave what do you
think?

Question... Is there a need to have a "map" container?

-- 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