News for hackers. Stuff that matters.
Re:Go Rocks - How Can We Avoid Something This Bad In The Fut... by pyrhho on Sunday July 10, 2011 @04:54AM (#2747374)
I really wanted to learn something from this post, but it's mostly just hyperbole and whining.

"It turns out that, in Go, you can't write a self-recursive anonymous function - there's no way to make it refer to itself. Well, you can do a dirty hack that's the "official work-around" (I'll let you google for the bug report)."

To summarize this argument: 1. It is impossible to have a self-recursive anonymous function in Go. 2. Oh wait.. It is completely possible, but far too ugly to soil this blog post.

I looked up the temporary solution (http://code.google.com/p/go/issues/detail?id=226). It is this:

    var recurse func()
    recurse = func() {
      recurse()
    }
The proposed permanent solution is allowing recursive function definitions, because that is the proper solution instead of adding a magic self keyword like other languages do.

(tl;dr The author just doesn't like the fairly-simple work-around proposed while the language is still developing)

Edit: There definitely are far more important things in Go I dislike, and would change, however this blog post is essentially fluff.

Re:Go Rocks - How Can We Avoid Something This Bad In The Fut... by a_strange_guy on Sunday July 10, 2011 @04:33PM (#2748558)
This is what they want:

    func outer(a int) {
        func inner_helper(b int) {
            ...
        }
    }
Pascal allowed nested functions 40 years ago...
Re:Go Rocks - How Can We Avoid Something This Bad In The Fut... by Peaker on Sunday July 10, 2011 @08:43PM (#2749050)
When saying "nested functions" in 2011, people expect you to mean lexically scoped nested functions.

Pascal's nested functions really just scoped the name of the function differently, but they were equivalent to a function definition on the outer-most level.