Reputation: 3855
I'm following some tutorials but got confused seeing these variables, what exactly are these and what are they called?
Upvotes: 2
Views: 242
Reputation: 121010
Those are module attributes.
There are some predefined module attributes, as described in Module
documentation. @impl
and @type
are the predefined ones, described in the documentation for Module
I referenced above.
It’s always a good idea to start with the language core and only then dive into frameworks, but since your question also mentioned phoenix-framework, it’s worth to mention that Phoenix nicely plays with module hooks, implicitly declaring some module attributes for convenient access to @assigns
and like, but this is surely out of the scope of your current journey.
Upvotes: 4