Re:Robpike/Lisp: Toy Lisp 1.5 interpreter in Go
by kodablah on Wednesday June 17, 2020 @01:29PM
(#23554123)
> I probably never would have done it that way, I would probably use an interface type instead
I think when you're all in the same package and accessing unexported fields you know about, this is much clearer than an interface. I often add unexported mutually exclusive fields that local code has advanced knowledge about to prevent unnecessary over-abstraction.
Re:Robpike/Lisp: Toy Lisp 1.5 interpreter in Go
by kccqzy on Wednesday June 17, 2020 @02:08PM
(#23554622)
And yeah, and then a new team member doesn't know certain fields are mutually exclusive, and neither does the compiler because of the lack of sum types.
I think when you're all in the same package and accessing unexported fields you know about, this is much clearer than an interface. I often add unexported mutually exclusive fields that local code has advanced knowledge about to prevent unnecessary over-abstraction.