C++: terser (shorter) lambda == SHORTY (ab-use?)
github.com
github.com
I started out trying to write something like the OP, but changed direction when I convinced myself there would have been no sane way to implement member call syntax. I honestly can't decide if it's cursed or genuinely useful (minus the unicode name, that's cursed).
[0] https://tgceec.tumblr.com/post/74534916370/results-of-the-gr...
From one of the entries:
> Extra credit for using Perl, which is the only language less readable than C++ templates.
But TIL dollar sign $ is also valid character for identifiers.
Has been like that in C since forever.
If you look in the project's pedantic.cmake, you'll find a add_c_and_cxx_compile_options("-Wno-dollar-in-identifier-extension") just to suppress warnings about this.
sts = sys$getjpiw(0, 0, 0, &jpi_itm_lst, 0, 0, 0);
if ((sts & STS$M_SEVERITY) != STS$K_SUCCESS)
That might be why GCC originally included $ support.While there are some new rules regarding arguments naming, the new syntax doesn’t feel more complex than the default lambda syntax.
So all in all I would say the most horrifying thing here is the fact that the language allows such extensions in the first place ;)
Or maybe I am too brainwashed by C++ at this point.
auto sum = [](auto a, auto b): a+b;
but this is something else. i didn't think i'd like it at first, but actually i think i might be coming around to it. the.. dollar syntax is regrettable, although it's not a show stopper.This seems to be more fully featured than all of those though. Maybe some could be ported over to Lambda2.