Regan Heath:

I would stop nesting the struct definition. I think that is both cleaner and closer to the original intent - the only reason it is nested in C is because C allows definition and declaration that way, and D does not. Then you don't need static at all.

It's mostly a matter of style, but here I prefer a little more the nested form. It's syntactically closer to the original C file, for a D programmer "static struct" has a known and clear meaning, and putting the structs inside the other keeps the global namespace clean of those inner names. Like with nested functions putting names inside other scoped helps the programmer see they are just needed there.

Bye,
bearophile

Reply via email to