This is a nice article, as a non-Python programmer who's dabbled a bit in order to read some random Python code, it gave me some appreciation for the "Pythonic"-way. I have to say though, that the thing that astonished me the most about Python is the Java-like "closures". I sort of thought it would be like Ruby, which I thought was closer to Scheme and JavaScript, and then I realized that Ruby isn't quite like them e…
> then I realized that Ruby isn't quite like them either. I am curious. How does Ruby's closure differ from Scheme's?
def foo (n)
lambda {|i| n += i } end
I expected to be able to do this: acc = foo(0)
acc(1)
But instead have to do acc.call(1)
Maybe there's another way...Edit: oops you pointed out this example in another comment, sorry! Is there no way for the returned lambda to "feel" like a regular function?