#Correct way to retrieve "subfields" from struct types via comptime string

1 messages · Page 1 of 1 (latest)

jagged cove
#

for instance, something like:

const Struct = struct {
    a: struct {
        b: struct {
            c: struct {
                d: i32 = 3,
            },
        },
    },
};

const instance = Struct{};
const d = @field(instance, "a.b.c.d");

Thank you!

abstract loom
#

you gotta nest @field calls

jagged cove
#

ah ok so this isn't supported out of the box

#

thanks @abstract loom !