Hi Tong,

Another implementation is https://play.golang.org/p/3_PDTCcJTi.
You could merge the interface Animal and ExtraFactsor together if this 
extra behavior is not needed. It is listed there just for demonstration.

On Thursday, November 24, 2016 at 12:14:37 AM UTC-8, Nick Patavalis wrote:
>
> On Thu, Nov 24, 2016 at 10:00 AM, Haddock <ffm...@web.de <javascript:>> 
> wrote: 
> > 
> > This is merely resorting to a shared function. This does not really 
> > cover overwriting in the OO sense. The article I mentioned shows how 
> > to do this: 
> > 
> http://objectscape.blogspot.de/2013/09/inner-pattern-to-mimic-method.html 
>
> Not really! Tong Sun's Animal.Output() method (with a Speaker 
> argument) is pretty-much "isomorphic" with Plohmann's Mamal.ActInner() 
> method (with an Animal argument). Maybe it's not as clearly named, but 
> it is pretty-much the same approach. 
>
> /npat 
>

-- 
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, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to