From: gabriele renzi Date: 2004-02-24T05:04:48+09:00 Subject: Re: Need examples comparing Ruby to Python il Mon, 23 Feb 2004 12:14:33 -0700, David MacQuigg ha scritto:: > >>but maybe, you should undeline that ruby has had oo+iterators since >>the beginning, while python added them later. This reflects in the >>'feeling' of the language, I believe > >I'm trying to avoid differences that are no longer true, and stay >neutral with regard to matters of personal preference, like the "feel" >of the language. This should get us down to just a few examples where >Ruby has an advantage. I don't think that is a personal preference :) I mean, in python you'll often see free function like len(obj) or dir(), while in ruby you'd do obj.length and obj.methods. That reflect on other things like hash keys. There are no special type in ruby, so you can use everything as an hash key. Another example that suddenly appeared to me: slightly different lexical closures: def make_accumulator (n) lambda {|i| n += i } end That is little harder in python cause you don't have access to the variable 'n' , just his object. BTW, as I said, little differences.