[go-nuts] Re: Inheritance and OOP: Go one better

2018-02-08 Thread matthewjuran
Closures and function types/fields may have a place in discussing OOP-like Go constructs. Matt On Thursday, February 8, 2018 at 10:47:04 AM UTC-6, Stefan Nilsson wrote: > > Here is a short article about how to do OOP in Go with composition, > structurally typed interfaces and, in some special c

[go-nuts] Re: Inheritance and OOP: Go one better

2018-02-13 Thread Haddock
Hi Stefan, your solution falls short on addressing the underlying problem of how to implement inheritance using dynamic dispatch through using interface. In the article "Inner Pattern to mimic Method Overwriting in Go "

[go-nuts] Re: Inheritance and OOP: Go one better

2018-02-13 Thread Stefan Nilsson
My goal is a different one. I'm trying to figure out how to best use the features of Go for code reuse and dynamic method dispatch _without_ inheritance. Inheritance is a pretty strange language construct. It combines several different features in one. In my experience it's rare that all of the

[go-nuts] Re: Inheritance and OOP: Go one better

2018-02-13 Thread Matt Ho
I’m not sure how an interface doesn’t satisfy what you’re looking for. Can you describe your use case in a little more detail? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, sen

Re: [go-nuts] Re: Inheritance and OOP: Go one better

2018-02-13 Thread Jesper Louis Andersen
On Thu, Feb 8, 2018 at 6:53 PM wrote: > Closures and function types/fields may have a place in discussing OOP-like > Go constructs. > > Yes! One can implement roughly any feature of the OO crowd with closures and types. Although it can be far more verbose to do so in the language. -- You receiv