[HN Gopher] Partial Function Application
___________________________________________________________________
Partial Function Application
Author : ibobev
Score : 12 points
Date : 2023-01-09 09:51 UTC (13 hours ago)
(HTM) web link (modernescpp.com)
(TXT) w3m dump (modernescpp.com)
| ktpsns wrote:
| I find the point-free function composition style so much more
| elegant then lambda functions. I acknowledge lambda functions are
| easier to read and work basically the same way in most
| contemporary multi-paradigm programming languages.
| vore wrote:
| Point-free composition can be more expensive and hard to
| optimize compared to anonymous functions, since you're now
| having to carry a heap-allocated closure around if you've
| partially applied arguments. Anonymous functions by contrast in
| C++ are super explicit about what they're capturing and you can
| be more sure of the allocations.
| gpderetta wrote:
| I expected to keep using boost::bind (and std::bind) even after
| we got lambdas in C++11.
|
| I don't think I have actually used them in years. Even though
| they can be succinct, they have some sharp corners and a non-
| trivial compilation time cost. In practice lambdas good enough in
| almost all cases.
___________________________________________________________________
(page generated 2023-01-09 23:00 UTC)