ZigZiggit

Discussion: A potential solution to the anytype problem (opens in new tab)

you need to what you can do in zig first before thinking about what it can’t do. i’m basically repeating my point but, the same can be done with the existing zig features like this fn satisfiesAnimal(comptime T: type) bool { var ret = @hasField(T, "age"); ret = ret and @hasField(T, "height") and @FieldType(T, "height") == u8; ret = ret and @hasDecl(T, "eat") and @TypeOf(T.eat) == fn (T) void; return ret; } that new sugar syntax is not worth it. also a builtin like @Self already exists and tha...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help