type Expr interface { Eval() float64 }
Instead of that being an empty interface and ditch the "Eval" interface? Or just require the structs to take instances of "Eval"? That way BinaryPlus won't accept the string without being wrapped in a type with an Eval method?
type Expr interface { Eval() float64 }
Instead of that being an empty interface and ditch the "Eval" interface? Or just require the structs to take instances of "Eval"? That way BinaryPlus won't accept the string without being wrapped in a type with an Eval method?