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
Suggestions (take or leave)
The various top-level functions all seem out of place.
Should they be methods?
Should the Fileset be recorded in the Package and File?
They are big enough that the extra space would not be
noticeable, and it would make them a little easier to use.
The text was updated successfully, but these errors were encountered:
The AST is kept minimal, it's essentially just a data structure (but for the Pos(),
End() methods). One could add more methods, but the question arises where to stop: When
is a method not part of the AST anymore, but a function operating on the AST. The
decision - made long ago - was to keep the AST free of such methods.
Some of the functionality crept it over time, yet the AST is still just a data
structure. Once such functionality becomes methods, one might ask why is printing, type
checking, etc. not implemented as methods. It's better to not add all this to the AST.
It would be nice if the FileSet would be recorded in the Package and File, but it
doesn't solve all use cases (operations om portions of the AST). Also, it doesn't work
if an AST contains pieces from different files (which is theoretically possible). I'd be
ok with that change as it is backward-compatible (except for the multiple files issue).
However, the go/printer would still need the separate FileSet for printing of partial
ASTs (decls).
The text was updated successfully, but these errors were encountered: