Thanks for the replies!
First @calmh, I was about to say that, for example, go is not scheme, that you have a small number of simple but powerful concepts or constructs, and then you let 'em multiply. And also, even in scheme, you’ve got ultimately strange stuff like call/cc. Almost in any language you can identify strangeness, such as python’s indent syntax, and go’s exact reversal of some aspects of C’s syntax such as []byte; those things can be argued, justified, and after a while, people defend them like an orthodoxy. Another case might be lisp’s syntax: at first, it was a problem too troublesome to be solved, so let us just write parens all over the place, and then, people began to think that’s exactly where the beauty is with lisp. etc. But, I suppose, this kind of argument can lead us to nowhere. ![:wink: :wink:](https://forum.golangbridge.org/images/emoji/google/wink.png?v=5)
Then @Matt_Singletary, it’s a solid argument. But, again, say, the doc’d rules regarding uintptr and unsafe.Pointer, or the rules regarding struct embedding and method sets and x.y syntax, ie. the elimination of C’s x->y, you do have rules 1, 2, 3, … to deal with the situations. And, also, look at things such as: &a[0], why don’t we have to write &(a[0]) ie with the parens? OK it’s because the precedence rules, but it’s also because (&a)[0] does not make sense in go. So the rules just falling in place. It does not create mental burden, rather it reduces the burden.
So, if the idea is to let, say, go f stmt to automatically becomes a go f() then what about stmt go f()() and stmt go f(a, b, c)?
or stmt v := f and stmt v := f()
I personally think the cases are pretty clearly separated by themselves. BTW, you’ve to write go func() func() { … return func() {…} } Notice the type of the return value is missed in your example. But, I guess, if my idea is implemented, maybe we’ll have a different FAQ item regarding eg this example should’ve been written as go func() { … go func() {…} } since return value to a go stmt is lost and probably not what the user wanted. While nowadays we have the FAQ item being go f should be written as go f() because this is what the user wanted while everyone incl. the complier can see it, it must be fixed by the user manually.
Regards,