On Monday, 7 October 2024 at 19:34:00 UTC, Sergey wrote:
On Saturday, 5 October 2024 at 06:35:57 UTC, ryuukk_ wrote:
all other C like languages allow me to be concise
Which one btw? Except C++
C#, Go and Zig seems against this functionality..
Don't lie brother
go:
```Go
package main
import "fmt"
type EntityDef struct {
stats struct {
hp int
}
}
func main() {
def := EntityDef{}
def.stats.hp = 42
fmt.Println(def)
}
```
zig:
```Zig
const std = @import("std");
const EntityDef = struct {
stats: struct {
hp: i32,
},
};
pub fn main() void {
const def = EntityDef {
.stats = .{
.hp = 42
}
};
std.debug.print("{}\n", .{def});
}
```