[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: What is this syntax?

e

2/13/2005 10:01:00 PM

> Lähettäjä: David Corbin <dcorbin@machturtle.com>
> Aihe: Re: What is this syntax?
>
> On Sunday 13 February 2005 12:54 pm, Robert Klemme wrote:
> > "David Corbin" <dcorbin@machturtle.com> schrieb im Newsbeitrag
> > news:200502131241.13403.dcorbin@machturtle.com...
> >
> > > def foo(*)
> > > end
> > >
> > > What does the "*" mean?
> >
> > Any number of arguments
>
> And the foo method just can't refer to them?

Right. Technically, I think, it creates an Array of the arguments but
doesn't assign the array to a variable:

def foo(*a)
end

The difference is that here the Array is bound to a for you to access.

E