What's TOTALLY COMPELLING about Ruby over Python?
John J. Lee
jjl at pobox.com
Tue Aug 19 00:03:12 CEST 2003
"John Roth" <newsgroups at jhrothjr.com> writes:
> It's not so much code blocks. It's that Ruby's syntax gives you one
> code block for free in every method call.
I don't know what that means. Care to explain a bit more?
> All of the Ruby collections implement a .each method, which is essentially
> like (using Python syntax):
> collectObj.each(<method name>)
> You can also say: we can do that with for. Well, duh. For is a
> statement, not a method call.
I don't understand. Why does this matter?
I guess you could implement this in Python if you had a burning
desire, using __metaclass__ (caveat: never having had such a desire,
I've never used metaclasses, so I may be wrong).
> To continue on this vein, Ruby directly implements Visitor, Observer,
> Delegate and Singleton. I don't particularly like the way it does some
> of them, but Python can't claim any one of the four!
More information about the Python-list