Quoting 'yinbingjun' via golang-nuts (2018-11-19 22:23:35)
> First go should support generic types.
There's ongoing discussion of this in the context of Go 2; see:
https://blog.golang.org/go2draft
Which also links to the full draft designs, as well as feedback pages
(with *lots* of feedback).
> And I recommend go support python’s decorator. It is very useful in
> programming.
I've found Go's anonymous functions cover basically everything you'd
actually want decorators for; This makes sense because python's
decorator syntax is just syntactic sugar, i.e.
@mydecorator
def myfun():
...
Is the same as:
def myfun():
...
myfun = mydecorator(myfun)
This is somewhat useful since Python's lambda is limited to a single
expression, but Go does not have this restriction, so you'd probably
just do:
myfun := mydecorator(func() {
...
})
-Ian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.