Possible method call error -> docstring above struct fields

I think the idea of a docstring is that it is one bit of text that describes the defined object independently of that definition itself (e.g. in docs or requested via the REPL). For structs fieldnames are often repeated in the docstring. You could repeat the field descriptions in comments next to the field definitions if you want.

On the other hand, you could probably also define a macro that collects the field descriptions into a single docstring which is put above the definition (if such a thing does not already exist, I didn’t find it with a quick Google search).

1 Like