Re:Why Python doesn't need blocks
by mpweiher on Monday June 30, 2014 @02:00PM
(#7966505)
Hmm...I am not sure what difference the author is making between closures and blocks, the terms at least overlap substantially.
For example, Smalltalk blocks have been "upgraded" to closures in most dialects (and not implementing them as closures in the first place was not a choice of semantics, but one of implementation simplicity).
Also, Swift closures are the same as Objective-C blocks.
+(void)logMe: (void (^)(void))block
{
NSLog(@"object of class: %@",[(id)block class]);
}
For example, Smalltalk blocks have been "upgraded" to closures in most dialects (and not implementing them as closures in the first place was not a choice of semantics, but one of implementation simplicity).
Also, Swift closures are the same as Objective-C blocks.
Called from Swift with a closure: Results in: So much ado about nothing?