In ocaml you can redefine operators... but only in the context of another module.
So if I re-define + in some module Vec3, I can do:
Vec3.(a + b + c + d)
let open Vec3 in a + b + c + d
a.add(b).add(c).add(d)
https://ziglang.org/documentation/master/#Vector
In ocaml you can redefine operators... but only in the context of another module.
So if I re-define + in some module Vec3, I can do:
Or even: So there you go, no "where did the + operator come from?" questions when reading the source, and still much nicer than: I doubt zig will change though. The language is starting to crystallize and anything that solved this challenge would be massive.