in reply to Re: Does Go steal from Perl? :-)
in thread Does Go steal from Perl? :-)
There are some dangerous misconceptions in this analysis.
Go is a strongly and explicitly typed language. There is no such thing as an undefined value and there is certainly no such thing as a numeric context. Instead, every variable has a well-defined, fixed type, specified (or inferred) when the variable is declared, and every type has a well-defined zero value, that is, any variable not explicitly assigned to will be initialized to the zero value of its type.
Let's look at the first line then:
In turn, the counts[input.Text()]++ line can be analyzed as follows:
It is likely that the authors of go recognized the code in question as a common idiom and wrote the language standard with it in mind, but the details explained above make it clear that the underlying concepts are rather different from those of Perl.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Does Go steal from Perl? :-)
by RonW (Parson) on Aug 06, 2018 at 22:14 UTC |