News for hackers. Stuff that matters.
Re:It is ridiculously easy to refactor Go by mahmud on Monday January 28, 2013 @12:50AM (#5127343)
Folks, recursive data-strcutures are CS101. Processing them is also a trivial, template-filling exercise. First you specify the (recursive) datatype, consisting of the simple "leaf" elements, along with the complex forms. Then you write your program consisting of a series of mutually recursive functions.

What matters is that once you specify the data type, the code that processes it follows immediately from the grammar.

Re:It is ridiculously easy to refactor Go by adam-a on Monday January 28, 2013 @06:09AM (#5128044)
I think you're slightly missing the point. It's not the use of recursive functions or data structures that is interesting. It's that, in Go, you can add a new type which covers externally defined types, and those types are now instances of the new type automatically. In other languages, to unify two types like this with a common interface, you would probably have to define a wrapper class which proxies the calls to the real objects. Even though the methods for the two classes have matching type signatures and do the same thing already.