error{} is side return with syntax support

  • Exception in Java/JavaScript/C#
  • error{} in Zig

Those are side returns with syntax support from the language.

They have nothing to do with the meaning of “error” or “exception”.

The naming is archaic, just like void in Zig is Unit in Lean.

Use this feature to create side return paths for any purpose.

I still don’t understand Zig…