>
>
> You have changed the question. You are no longer asking about defining
> methods on a type derived from a primitive type. Non-aliased types are
> deliberately distinct types that cannot be "auto downcast" or "auto
> upcast". Arguably the biggest flaw of the C language was its automatic type
> coercion. And I say that as someone who had been programming for several
> years but didn't find a language I loved until I learned C sometime around
> 1984. What you are proposing would lead to a huge number of bugs that
> result from the C/C++ behavior you are advocating for. And that ignores the
> technical difficulties of doing what you propose unless Go becomes more
> like C++. Which most Go users, and I'm sure everyone on the Go development
> team, would argue is a bad idea.
>
> --
> Kurtis Rader
> Caretaker of the exceptional canines Junior and Hank
>

Eh, I'm not really proposing anything. I'm interested in the why, I think I
worded it badly in my last email, apologize about that, but the change in
the question is because the statement that type in different package cannot
be bounded/attached with new methods, so, ok, if we need to create new type
to attach new methods to these foreign types, why is there no, type
coercion, as you said, that allow the new type to be acknowledged as its
underlying type? which will not be a question if otherwise Go has mechanism
to allow methods to be attached to foreign types. I even deliberately not
mentioned another modern language that allows this to a foreign type, not
to compare Go with anything.

But ok, I should take the answer as: it will make Go more C/C++ like, and
it's bad. Sure.

-- 
regards,
Nurahmadie
--

-- 
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/CA%2BcQEWF6KFvtG1WRr8bBPJpa646diQBiS_pzKHL-8OMhKwzG8w%40mail.gmail.com.

Reply via email to