def entryExit(f): def new_f(): print "Entering", f.__name__ f() print "Exited", f.__name__ return new_f @entryExit def func1(): print "inside func1()" @entryExit def func2(): print "inside func2()" func1() func2() print func1.__name__
같은 방식으로 사용할수 있다고 알고 있는데요.
golang에서는 python/decorator,java/annotation 같은 기능이 있는지 궁금하네요. (혹시 없으면, 다른 더 좋은 방법이 있어서 그런건지, 혹은 decorator,annotation같은 방식이 문제가 있는 건지 궁금하긴 합니다.)
golang에서는 function을 curry할수 있을까요? http://en.wikipedia.org/wiki/Curry_(programming_language)
혹시 golang에는 python PEP같은 언어 디자인 제안 문서가 따로 존재하나요? http://www.python.org/dev/peps/
----
읽어 주셔서 감사합니다.
"I thought I would miss list comprehensions a lot, but I find that
their absence results in cleaner code that is easier to understand
even when compared to relatively simple list comprehensions [in
Python]." -- Thirsteh
http://go-lang.cat-v.org/quotes
see also: https://groups.google.com/forum/?fromgroups=#!msg/golang-nuts/cC8sx5MUYDc/PeTuczpc1ZIJ
대신에 Map을 사용하는 예제 코드는 본 적이 있습니다. Map, Filter가 사실상 LC와 동등한 표현력을 가졌기 떄문에
아쉽다면 Map이나 Filter를 쓰시는 것도 한 방법인 것 같습니다.
또 파이썬의 데코레이터는 순수한 신택스 슈가인데요. 거기에 딱 맞는 GO언어 피쳐는 없는 것 같습니다.
GO언어는 메일링 리스트와 챗을 통해서 언어를 개선해 나가는데 현재의 상태에서 PEP같은 작업을 하기에는 문서 작업의 부담이 큰 것 같습니다.
Regards,
Leonardo YongUk KIM
2012/8/31 zestizer <zest...@gmail.com>:
> --
> --
> * 이 그룹에 이메일로 게시하려면 다음 주소로 이메일을 보내시면 됩니다.
> golang...@googlegroups.com
> * 추가 옵션을 보려면 http://groups.google.com/group/golang-korea?hl=ko?hl=ko의 그룹을
> 방문하세요.
>
>