You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe we explicitly decided to have variables (or definitions that are not function-like) to not be recursive, and hence, not 'forward-referencable'. If having data at the end of the file is the only use case we have for this, I don't think it justifies any change in the language.
Moreover, even if it was possible, I think it'd be better style to have data-like definitions in a separate file.
This has come up during Advent of Code.
Example:
data
which you use in the file,data
in a separate module and import the module.One could want to have it in the same module, but at the end, with a forward declaration at the beginning.
The text was updated successfully, but these errors were encountered: