ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
atk has quit [Quit: Well this is unexpected.]
atk has joined #zig
alexnask has quit [Ping timeout: 240 seconds]
<GitHub166>
[zig] isaachier opened pull request #1158: Fix os_path_join for case where dirname is empty (master...os-join-empty-path-fix) https://git.io/f49Tl
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
JinShil has joined #zig
kristate has joined #zig
kristate has quit [Ping timeout: 240 seconds]
dbandstra has joined #zig
<dbandstra>
is there a convenient way to loop through enum values?
<dbandstra>
i have var i: u32 = 0; while (i < @memberCount(SomeEnum)) : (i += 1) { const value = @intToEnum(SomeEnum, @intCast(@typeInfo(SomeEnum).Enum.tag_type, i))); }
<MajorLag1>
Have you tried taking the @typeInfo, then doing `for(type_info.Enum.fields) |field| { ... };` ?
<MajorLag1>
field will have a .name and .value
<dbandstra>
hmm it's nice to be able to use a for loop but field.value seems to be a usize so unfortunately the @intToEnum is still needed
<dbandstra>
do you know what the `defs: []Definition` thing is? i tried using it but th ecompiler crashed
mahmudov has quit [Remote host closed the connection]
xtreak has quit [Remote host closed the connection]
xtreak has joined #zig
xtreak has quit [Remote host closed the connection]
very-mediocre has quit [Ping timeout: 260 seconds]
JinShil has quit [Quit: Leaving]
xtreak has joined #zig
zolk3ri has joined #zig
quc has joined #zig
xtreak has quit [Remote host closed the connection]
zakora has joined #zig
xtreak has joined #zig
noonien has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<MajorLag1>
You still need @intToEnum because the TypeInfo structure's fields have static type. []Definitions holds information about namespaced constants, variables, and functions, if your Enum type has any.
xtreak has quit [Ping timeout: 276 seconds]
alexnask has joined #zig
<alexnask>
@dbandstra Hit me up if you have questions about @typeInfo, I wrote it
<alexnask>
I would appreciate a pastebin of the code that made the compiler crash too
davr0s has joined #zig
<alexnask>
I will finish off basic @reify today or tomorrow and start working on std.meta after that, you sould be able to do something like for(meta.enum_fields(EnumType)) |field| { ... } after that