Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(20)

Issue 6500092: code review 6500092: faq: go does not have duck typing (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 8 months ago by r
Modified:
12 years, 7 months ago
Reviewers:
mortdeus, rsc
CC:
golang-dev, 0xjnml, iant, adonovan, aram
Visibility:
Public.

Description

faq: go does not have duck typing

Patch Set 1 #

Patch Set 2 : diff -r 4a9c3b3e39c6 https://code.google.com/p/go #

Total comments: 1

Patch Set 3 : diff -r 4a9c3b3e39c6 https://code.google.com/p/go #

Patch Set 4 : diff -r 4245c8cdc599 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M doc/go_faq.html View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 16
r
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
12 years, 8 months ago (2012-09-07 18:50:57 UTC) #1
0xjnml
On Fri, Sep 7, 2012 at 8:50 PM, <r@golang.org> wrote: 'By the way, Go does ...
12 years, 8 months ago (2012-09-07 19:42:26 UTC) #2
iant
https://codereview.appspot.com/6500092/diff/3001/doc/go_faq.html File doc/go_faq.html (right): https://codereview.appspot.com/6500092/diff/3001/doc/go_faq.html#newcode556 doc/go_faq.html:556: By the way, Go does not have "duck typing", ...
12 years, 8 months ago (2012-09-07 20:06:11 UTC) #3
r
I could drop it and keep just the s/duck/structural/. The reason I added this paragraph ...
12 years, 8 months ago (2012-09-07 20:17:58 UTC) #4
iant
LGTM I'm ambivalent.
12 years, 8 months ago (2012-09-07 20:19:28 UTC) #5
r
On Fri, Sep 7, 2012 at 1:19 PM, <iant@golang.org> wrote: > LGTM > > I'm ...
12 years, 8 months ago (2012-09-07 20:20:24 UTC) #6
0xjnml
On Fri, Sep 7, 2012 at 10:06 PM, <iant@golang.org> wrote: > > https://codereview.appspot.com/6500092/diff/3001/doc/go_faq.html > File ...
12 years, 8 months ago (2012-09-07 20:28:03 UTC) #7
adonovan
On 7 September 2012 16:28, Jan Mercl <0xjnml@gmail.com> wrote: > a := "1" > b ...
12 years, 8 months ago (2012-09-07 20:51:21 UTC) #8
r
Hello golang-dev@googlegroups.com, 0xjnml@gmail.com, iant@golang.org, adonovan@google.com (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 8 months ago (2012-09-07 20:53:18 UTC) #9
iant
On 2012/09/07 20:51:21, adonovan wrote: > > I think duck typing more commonly refers to ...
12 years, 8 months ago (2012-09-07 20:55:12 UTC) #10
iant
LGTM
12 years, 8 months ago (2012-09-07 20:55:30 UTC) #11
aram
LGTM Finally. Thanks.
12 years, 8 months ago (2012-09-07 21:00:09 UTC) #12
r
*** Submitted as http://code.google.com/p/go/source/detail?r=d3d3e0825dd2 *** faq: go does not have duck typing R=golang-dev, 0xjnml, iant, ...
12 years, 8 months ago (2012-09-07 21:01:06 UTC) #13
0xjnml
On Fri, Sep 7, 2012 at 10:51 PM, Alan Donovan <adonovan@google.com> wrote: > On 7 ...
12 years, 8 months ago (2012-09-07 21:06:00 UTC) #14
rsc
LGTM Hard to care much about precise definitions. If it quacks like duck typing, it's ...
12 years, 7 months ago (2012-09-10 16:20:13 UTC) #15
mortdeus
12 years, 7 months ago (2012-09-28 21:19:28 UTC) #16
On 2012/09/10 16:20:13, rsc wrote:
> LGTM
> 
> Hard to care much about precise definitions. If it quacks like duck
> typing, it's duck typing.

The difference between structural typing and duck typing is that duck typing
observes the object being passed in as an argument at runtime.

Structural typing is static and therefore very different when you consider
things you cant do with go's interfaces. The primary example for python is
monkey patching. I.E. hot patching python source further ahead in the path of
your codes execution with a different type depending on which way the code's
execution flows.

So in the perspective of the runtime, how you look at Go's interfaces, and
python's duck type is alot different. Python's types look like a duck, walks
like a duck, and quacks like a duck when its encountered, so ill assume its a
duck. This is alot different than an interface with a big sign on it that says
"Certified 100% Authentic Duck -Gopher Type Introspective Association". :)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b