One of the most pressing naming discussions of our time: when you have a sum type `Token`, `Expr`, etc. and then a wrapper containing it + some common info (like trivia for `Token`, a source span for other nodes) what do you call the two? I used to always default to `Expr` and `ExprData`, but rustc generally defaults to `ExprKind` and `Expr`, despite `ExprKind` containing lots of data beyond just the plain `enum` that it represents: https://doc.rust-lang.org/beta/nightly-rustc/rustc_ast/ast/enum.ExprKind.html
Obviously, the best solution is to allow variants to have common fields, but is there a good naming scheme that works in the absence of this?
zwarich
@zwarich@hachyderm.io
Programming language & compiler enthusiast, computer architect. Creator of Rosetta 2.
hachyderm.io
2
0
1
Loading comments...