This post originated from an RSS feed registered with Java Buzz
by Weiqi Gao.
Original Post: Comment On Alex Winston's Blog
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Your comment submission failed for the following reasons:
You are not allowed to post comments.
Posting as: weiqigao Allowable html: a href,br/,p,b,strong,em,i,ol,ul,li,blockquote,pre
So I'll post what would have been a comment on that blog here. This is in response to a Cay Horstmann comment that reads:
Cay Horstmann:
I think int plus2(int) is a non-starter. Don't entangle the declared variable within fragments of the type. That approach has been thoroughly discredited after it made a disastrous appearance in C/C++. Try writing a function that yields an int=>int function using your syntax...
@Cay, it is actually quiet simple to write such a function:
int makeAdder(int n)(int x) = int (int n)(int x) {
return int(int x) { x + n };
}