News for hackers. Stuff that matters.
Re:Zig, Skia, Clojure, Geometry and the Japanese TV Show: IC... by AndyKelley on Thursday July 15, 2021 @07:33PM (#27851334)
> except this doesn't work any more

it does in zig:

    fn create_mocks() !struct {bar: Bar, baz: Baz, quux: Quux} {
        var bar = try make_bar();
        errdefer cleanup_bar(bar);
        var baz = try make_baz();
        errdefer cleanup_baz(baz);
        var quux = try make_quux();
        errdefer cleanup_quux(quux);

        return .{
            .bar = bar,
            .baz = quux,
            .quux = quux,
        };
    }
Re:Zig, Skia, Clojure, Geometry and the Japanese TV Show: IC... by Arnavion on Thursday July 15, 2021 @07:36PM (#27851364)
You've misunderstood. The thing that's being tested is not make_*, it's do_something_with()
Re:Zig, Skia, Clojure, Geometry and the Japanese TV Show: IC... by dnautics on Friday July 16, 2021 @12:25AM (#27853042)
You didn't read the function signature.
Re:Zig, Skia, Clojure, Geometry and the Japanese TV Show: IC... by Arnavion on Friday July 16, 2021 @04:15AM (#27854029)
I did.