3 ms·
"roughly equivalent"? They're chalk and cheese to me. Python metaprogramming, anyone? Each? Blocks? Real lambdas? Don't get me started. I'm not saying you can't
by cutler 5y ago
"roughly equivalent"? They're chalk and cheese to me. Python metaprogramming, anyone? Each? Blocks? Real lambdas? Don't get me started. I'm not saying you can't do it, just why would you want to when you end-up with something that doesn't resemble what you started with?
- viraptor 5y agoRoughly equivalent as in they have very similar object model and each construct is trivial to convert into the other. each is just a fancy for with new scope, blocks can be replaced with local functions, etc. They don't have anything that's not a trivial transform away (like for example: tail calls, callcc, macros, compile time transformations, ...). I mean, you may prefer one of these: foo.each { |i| ... } for i in foo: ... but after fixing up the scope issues, they're the same thing.