<gamester>
Barabas: as you can see there is some redundancy between @typeinfo and other @ functions, later you'll probably use std.meta which just uses @typeInfo: https://github.com/ziglang/zig/issues/1104
<gamester>
will just use* - std.meta does not exist yet, I think
<gamester>
or at least I think it's not finished
<Barabas>
ok
<Barabas>
the fields.value is a bit weird, as I expected it to return ... oh well maybe it makes sense. At first I thought it would be of the enum type, but it's a usize.
<Barabas>
or sorry, comptime_int
<gamester>
you can get the tag type like this: @typeInfo(your_enum).Enum.tag_type
<gamester>
also take a look at std.meta, it seems there's good stuff in there
tankf33der has joined #zig
develonepi3 has joined #zig
Ichorio has quit [Ping timeout: 245 seconds]
diltsman has quit [Ping timeout: 256 seconds]
scientes has joined #zig
darithorn has joined #zig
<Barabas>
How do you make a field of a (tagged) union active?
<Barabas>
I tried doing
<Barabas>
my_union.Field = undefined;
<Barabas>
but there it complains that it accesses an inactive field :(
<hio>
I think you have to reinitialize the whole thing
<hio>
my_union = union { .Field = 3 }
<Barabas>
Hm... ok, yes that seems to work.
_whitelogger has joined #zig
scientes has quit [Ping timeout: 245 seconds]
darithorn_ has joined #zig
darithorn_ has quit [Read error: Connection reset by peer]
<mikdusan>
my new favourite error: return error.WIP;
darithorn_ has joined #zig
darithorn__ has quit [Ping timeout: 250 seconds]
wootehfoot has quit [Read error: Connection reset by peer]
<andrewrk>
mikdusan, nice- I'm also a fan of @panic("TODO")
darithorn_ has quit [Read error: Connection reset by peer]
darithorn_ has joined #zig
darithorn_ has quit [Read error: Connection reset by peer]
darithorn_ has joined #zig
Akuli has quit [Quit: Leaving]
vramana has quit [Quit: Connection closed for inactivity]
Ichorio has quit [Ping timeout: 245 seconds]
dewf has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<daurnimator>
mikdusan: I prefer NYI
<daurnimator>
WIP suggests you'll actually come back to it later ;)
<daurnimator>
though @panic("NYI") is probably better: it doesn't mess up error signatures...... though maybe that's a good thing: if a function has NYI in it's error set you know it isn't ready to use yet....
<daurnimator>
though I more often deal with scenarios where I'm *not allowed to throw*, so the @panic is preferable