3 ms·
Cool idea. The way it handles alternatives looks awkward since each alternative is a field in a struct. You have to check each field to find the one that's not
by skybrian 8y ago
Cool idea. The way it handles alternatives looks awkward since each alternative is a field in a struct. You have to check each field to find the one that's not nil.
(See Term in the example.)
Normally this would be done with an interface, like in go/ast
- skybrian 8y agoAlthough, on second thought, this means writing a chain of if-else statements instead of a type switch in a visitor. Maybe it's not that big a difference?