I like how in Swift grammar, structs and enums are basically just groups for regular bindings.
Uncategorized
1
Posts
1
Posters
0
Views
-
I like how in Swift grammar, structs and enums are basically just groups for regular bindings. It's neat.
```
struct X {
let a: Float32 = 10.0;
var b: Float32;
}
```But, I also like the Zig thing where they use a prefix, rather than an (optional) separator for delimiting fields. That unifies access and definition in a pleasing way (i.e. you can text search for `.a`, finding both definitions and field accesses.
```
struct X {
.a: Float32 = 10
.b: Float32
}
``` -
undefined oblomov@sociale.network shared this topic on