From d9ec57037d1f16523bebaa8e37c9802981b19e75 Mon Sep 17 00:00:00 2001 From: zegonix Date: Mon, 19 Oct 2026 17:29:09 +0200 Subject: [PATCH] (odin) reflection tests --- odin/src/main.odin | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/odin/src/main.odin b/odin/src/main.odin index 788488b..abb26fc 100644 --- a/odin/src/main.odin +++ b/odin/src/main.odin @@ -3,13 +3,18 @@ package test_project import "core:os" import "core:fmt" import "core:math" +import "core:reflect" + +test_t :: struct +{ + x: int `x coordinate and stuff`, + y: int `y coordinate you know` +} main :: proc() { - test: string = "heloo"; - length: int = len( test ); - digits: int = int( math.log10( f32( length ) ) ); + tags := reflect.struct_field_tags( test_t ); - digits = 3; - fmt.printfln( "% *d : %s", digits, length, test ); + fmt.println( typeid_of( type_of( tags ) ) ) + fmt.println( tags ); }