From: "Mauricio Fernández" Date: 2003-03-21T18:23:11+09:00 Subject: Re: Strong advantages over Python On Fri, Mar 21, 2003 at 05:54:00PM +0900, Lennon Day-Reynolds wrote: > The specific difference I was trying to illustrate was the ability to, > in Ruby, add a method to an existing class, and have that change then > cascade through to each instance of the class. To use a trivial example, > if I were to add an 'average' method to the array method like so... > > class Array > def average > sum = 0.0 > self.each {|i| sum += i} > sum / self.size > end > end > > ...any existing instances of Array would then have this method > available. In Python, however, I would have to re-define/load the class, > then re-instantiate any objects of that type in order to access the new > instance method. This isn't what can be inferred from http://www.ruby-talk.org/67397. -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com Linux: Where Don't We Want To Go Today? -- Submitted by Pancrazio De Mauro, paraphrasing some well-known sales talk