News for hackers. Stuff that matters.
Re:Lambdas in C by snorkel on Friday July 01, 2011 @04:15PM (#2719985)
Cute, but functions pointers suit me just fine.
Re:Lambdas in C by huhtenberg on Friday July 01, 2011 @06:14PM (#2720353)
Anonymous functions are very handy, and I think they should really be taken a step further. There's really no reason why it shouldn't be possible to pass an actual function body where a function pointer is required:

  int v[...];

  qsort( v, ..., (a, b) { return *(int*)a - *(int*)b } );
Such usage would also have an added benefit of letting the compiler do the type inference for a, b and the return value and not needing to explicitly specify them in qsort() call.
Re:Lambdas in C by CamperBob on Saturday July 02, 2011 @12:52AM (#2721031)
Local functions would be a nice compromise between the unreadable glop that was posted and the need to declare an entirely separate function to execute localized actions.