From: Ben Nagy Date: 2006-08-10T20:53:27+09:00 Subject: Re: Method arguments. But one general method of avoiding assignment or restatement is instance_eval "this is a test".instance_eval {self[4..self.length]} ben > -----Original Message----- > From: Paul Battley [mailto:pbattley@gmail.com] > Sent: Thursday, August 10, 2006 6:27 PM > To: ruby-talk ML > Subject: Re: Method arguments. > > On 10/08/06, Sard Aukary wrote: > > Is there a way to refer to the arguments passed to a > function, so I can > > avoid re-stating the argument inside it like the example below? > > > > puts "this is a test"[4.."this is a test".length] > > In this case, it's unnecessary: > > "this is a test"[4..-1] > > Paul >