My review.
- What is your evaluation of the design?
Extremely simple, solving a very narrow use case.
- What is your evaluation of the implementation?
Unimpeachable. There isn't much to get wrong in 79 lines of code.
- What is your evaluation of the documentation?
Describes the capabilities of the library perfectly clearly.
- What is your evaluation of the potential usefulness of the library?
Since c++14, I have not seen a use case for any library implementations of
lambdas or std::bind at all.
- Did you try to use the library? With which compiler(s)? Did you
have any problems?
Yes, gcc. No issues.
- How much effort did you put into your evaluation? A glance? A quick
reading? In-depth study?
I ignored the simple use cases in the documentation and decided to see if I
could make the library do something more interesting. See below.
- Are you knowledgeable about the problem domain?
Yes
Analysis:
To begin with I wrote a simple function involving c++ lambdas that did not
do arithmetic:
int main1() {
auto source = std::vector{"the"s, "cat"s, "sat"s, "on"s, "the"s, "mat"s};
auto dest = decltype(source)(source.size());
std::transform(source.begin(), source.end(), dest.begin(), [](auto _1) {
for (auto &c : _1)
c = static_cast<char>(std::toupper(static_cast<unsigned char>(c)));
return _1;
});
std::for_each(dest.begin(), dest.end(), [sep = ""](auto &&x) mutable {
std::cout << sep << x;
sep = ", ";
});
std::cout << std::endl;
return 0;
}
The salient part is the transform, but I will comment on the printing of
the result later.
I wondered whether it would be possible to express this transform in terms
of boost::lambda2.
What I really wanted to be able to write was this:
std::transform(source.begin(), source.end(), dest.begin(), uppercase(_1));
However, this is not possible since lambda2 leverages only
arithmetic operators.
So I settled on this:
std::transform(source.begin(), source.end(), dest.begin(), uppercase < _1);
Then I added some boilerplate, which I was able to implement in terms of
lambda2:
constexpr struct uppercase_t {
} uppercase;
template <class C>
concept character =
std::is_same_v
The Boost formal review of the Lambda2, authored by Peter Dimov, starts Monday, March 22, 2021 to March 31, 2021 (inclusive).
Documentation: https://pdimov.github.io/lambda2/doc/html/lambda2.html Source: https://github.com/pdimov/lambda2/
Lambda2 is a simple, but functional, C++14 lambda library. It takes advantage of the fact that the standard <functional> header already provides placeholders _1, _2, _3, and so on, for use with std::bind, and function objects such as std::plus, std::greater, std::logical_not, and std::bit_xor, corresponding to arithmetic, relational, logical and bitwise operators.
Please provide in your review information you think is valuable to understand your choice to ACCEPT or REJECT including Lambda2 as a Boost library. Please be explicit about your decision (ACCEPT or REJECT).
Some other questions you might want to consider answering:
- What is your evaluation of the design? - What is your evaluation of the implementation? - What is your evaluation of the documentation? - What is your evaluation of the potential usefulness of the library? - Did you try to use the library? With which compiler(s)? Did you have any problems? - How much effort did you put into your evaluation? A glance? A quick reading? In-depth study? - Are you knowledgeable about the problem domain?
More information about the Boost Formal Review Process can be found at: http://www.boost.org/community/reviews.html
The review is open to anyone who is prepared to put in the work of evaluating and reviewing the library. Prior experience in contributing to Boost reviews is not a requirement.
Thank you for your efforts in the Boost community. They are very much appreciated.
Peter is often available in the CppLang Slack #boost channel should you require any clarification not covered by the documentation. I am not frequently available in the Slack channel, but I'll certainly pay attention to the discussions. Please don't hesitate to ping me if needed.
Cheers, --Joel de Guzman
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost