On Friday, June 7, 2019 at 3:01:04 PM UTC-4, Burak Serdar wrote:
>
>
> If one library defines string.Render() for html, and another defines 
> another string.Render() for, say, a graphics library, which Render 
> will be called when I call "str".Render()? 
>
> Thanks for the explanation. That makes sense.  Thinking it over, I'm 
wondering what would be required for the compiler to recognize synonyms of 
the form 'type Foo Bar' and allow passing a Foo for an argument of type 
Bar.  The compiler knows the expected type of each function argument so it 
seems as if checking to see if a passed argument is a simple synonym for 
the expected type and doing a coercion doesn't seem like a big task.  Note 
that this is different than asking for, say, numeric conversion from int to 
float64 because those types are not synonyms.  I actually like the fact 
that Go forces you to explicitly convert numeric types.


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/aa26152a-fc5c-4048-9d30-446960df0ea9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to