Re:How Ruby Borrowed a Decades Old Idea From Lisp
by djacobs on Tuesday September 18, 2012 @02:37PM
(#4539761)
As far as I know, the language-free concept of "block" is orthogonal to the concept of scope. That is, a block is not by necessity a closure.
[ Parent
| on HN ]
Re:How Ruby Borrowed a Decades Old Idea From Lisp
by pat_shaughnessy on Tuesday September 18, 2012 @03:06PM
(#4539911)
You might be right about the general meaning of the term "block." However, in Ruby blocks happen to be implemented as closures. This was one of the main points I was trying to make... that blocks aren't as simple as they seem, at least in Ruby.
Re:How Ruby Borrowed a Decades Old Idea From Lisp
by djacobs on Tuesday September 18, 2012 @06:31PM
(#4540865)
That's a totally legitimate point. I'm just pointing out that the quoted bit would lead the reader to believe that a block is defined as a closure.
The problem is almost everyone I talk to in the startup scene thinks that an anonymous function/block == a closure.
Re:How Ruby Borrowed a Decades Old Idea From Lisp
by chimeracoder on Tuesday September 18, 2012 @10:57PM
(#4541813)
> The problem is almost everyone I talk to in the startup scene thinks that an anonymous function/block == a closure.
This is a big pet peeve of mine - I keep seeing people use 'closure' as a synonym for 'lambda'. It's a simple error, but it bugs the hell out of me.
Then again, it's a dead giveaway that the person has never programmed in a functional paradigm, which may be a good thing to know, depending on the context.