[ prog / sol / mona ]

prog


Zig

7 2023-10-15 18:23

>>6

Zig has annonymous structs and "typeless" enum literals
Like .{ 1, 2, "hello world" } is a tuple,
it could have the type Tuple(.{ i32, i32, []const u8 }) for example
(the compiler will automatically infer it)

An expression like .word is an enum literal, it can be casted into an enum,
provided that enum has the field "word" defined.

Zig's comptime is dynamically typed and lazy (even tough the runtime
is static and strict) so you can manipulate arbitrarily complicated expressions like that.

30


VIP:

do not edit these