Zig NEWS

Discussion on: Easy Interfaces with Zig 0.10.0

Collapse
 
yuyoyuppe profile image
Andrey Nekrasov

Wouldn't it be a bit more readable like this?

   pub fn talk(self: Animal) void {
      switch (self) {
         inline default => |case| case.talk(),
      }
   }
Enter fullscreen mode Exit fullscreen mode
Collapse
 
jiacai2050 profile image
Jiacai Liu

I'm afraid not, this required changes to language syntax, which is not a must.