Boost logo

Boost :

Subject: Re: [boost] Assign V2 - first impression
From: er (er.ci.2020_at_[hidden])
Date: 2011-06-24 13:40:46


On 6/24/11 12:06 PM, Christopher Jefferson wrote:
>
> On 24 Jun 2011, at 10:24, er wrote:
>
>>
>>> I am sure that it is a powerful library, but I really have no idea at all what is going on. I can't even parse the first line as valid C++ in any way. You need better examples, and also is that really the best way you could find to express repeating?
>>
>> If I try to imagine what the interface would look like after taking into account some of the suggestions that were made, this sentence:
>>
>> "Create data elements by mapping 1, 10, 100, 1000 by function f, and insert each result in cont by invoking modifier push_front."
>>
>> translates to
>>
>> (
>> push_front<1>( cont ) % ( _data = f ) % ( _repeat = n )
>> )( 1, 10, 100, 1000 );
>>
>>
>> Questions :
>> - is it more readable, now?
>
> That is more readable.

Thanks.
>> - What if each example was preceded by its English equivalent. Is this a bit of stretch or a reasonable approach?
> I think this is a good idea. In general I think you can't over-explain basic examples.

OK, Thanks.

>
> The style the library is using is still.. interesting. I'm still not sure why the '_repeat = n' comes in, and things seem attached strangely. I might perfer something that looked more like boost range's
>
> make_range(1,10,100,1000) | f | push_front(cont)

I will answer this, but please note that I caused some confusion in
answering Steward R. I just posted a correcting message, which perhaps
will clarify where option ( _repeat = n ) was meant to achieve, in that
case.

>
> But, that might well not design as well as I think it would, or not do what you are suggesting.
>
> Chris
> _______________________________________________
> Unsubscribe& other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk