News for hackers. Stuff that matters.
Re:Zig's dot star syntax (value.*) by toasterlovin on Saturday March 08, 2025 @07:14PM (#43304856)
> Yes, but unlike C's terribly confusing "declaration follows usage" style, which no tells you about btw

I happen to be reading the K&R C book right now and they do in fact tell you this.

Re:Zig's dot star syntax (value.*) by ajross on Saturday March 08, 2025 @07:59PM (#43305138)
Yeah, not sure where that came from. The ANSI C standard was extensively documented in books and articles and specs at all levels of rigor starting from the mid-80's. No one has ever lacked for a reference for how function pointer declaration looks.

That said, C's function pointer declaration syntax is indeed awful. But really that's because ANSI took a very hardline "no incompatible changes" tact when adding prototypes to the language, which limited the ways they could express them. That decision is one of the reasons we're still writing C today. Any yahoo can come up with a new language, kids do it all the time. ANSI's job was to add features to the language in which Unix was already written.

Re:Zig's dot star syntax (value.*) by cassepipe on Sunday March 09, 2025 @07:02AM (#43307964)
Well it's been lost on every C online tutorial I guess

I have not read it so that's on me I guess