News for hackers. Stuff that matters.
Re:John Carmack on Inlined Code by kllrnohj on Wednesday October 09, 2024 @03:31PM (#41791753)
Not that bad?

    int main() {
        int a = -1;
        [&] {
            a = 42;
            printf("I'm an uncallable inline block");
        }();

        printf(" ");

        [&] {
            printf("of code\n");
        }();

        [&] {
            printf("Passing state: %d\n", a);
        }();

        return 0;
    }
Re:John Carmack on Inlined Code by a_t48 on Wednesday October 09, 2024 @03:40PM (#41791824)
It’s not horrible, a little bit verbose though.
Re:John Carmack on Inlined Code by int_19h on Wednesday October 09, 2024 @07:21PM (#41793887)
At this point, why wouldn't you just use a nested block?