Sobeston / zig.guide

Repo for https://zig.guide content. Get up to speed with Zig quickly.
https://zig.guide
MIT License
647 stars 170 forks source link

Confused by enum explanation #214

Open konrad-arista opened 7 months ago

konrad-arista commented 7 months ago

The enum explanation with respect to namespaced function accessible with dot syntax. What does this mean? How am I able to access the method on both an element in the enum, but also on the type itself? I think this should be explained a bit further. https://github.com/Sobeston/zig.guide/blob/master/website/docs/01-language-basics/15-enums.mdx https://zig.guide/language-basics/enums

Specificaly this is confusing:

try expect(Suit.spades.isClubs() == Suit.isClubs(.spades));