-
Notifications
You must be signed in to change notification settings - Fork 345
Use Struct instead of __struct__/0 in sidebar #1446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Struct instead of __struct__/0 in sidebar #1446
Conversation
That is true. Before I have report the issue I was not aware that we can add @doc to |
That's a good point. The other thing to consider is that we have other public structs in the standard library: at least Should they all document |
I think that if it is renamed ' I think it add value, and it encourages users to document |
I don't think that's an issue. Macros are under functions too since at the end they are functions that receive and return AST. Structs are also powered by functions. I think it is all fine. I guess another option is to rename it to So with all that said: Should they all document |
Why does it have to be all or nothing? A quick search throws these files are usin defstruct: (deprecated and hidden should be excluded from the list)
|
|
I would say so. It aids when pattern matching them |
So then we should merge this PR and make an effort to document all public structs in Elixir on top of Note that, because |
Maybe we could post in ElixirForum asking people who want to contribute to it. I have been wanted to do something like this with all the Exceptions. as of now the only way to know how most of them work is by reading the source code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship it!
Exceptions are trickier because nothing in an exception is public unless explicitly said otherwise. And I don't think we should go ahead and make everything all of our exceptions public, except for a few, such as ArgumentError and RuntimeError. |
I was no aware that they were meant to be private. Still, writing about them, when they raised and maybe examples will be helpful for developers. |
Closes #1433
/cc @NickNeck
There is one issue though, is that
%Task{}
is not a function