From: Justin Collins Date: 2010-05-04T18:55:54+09:00 Subject: Re: * splat error Ruby Knight wrote: >> def s(a,*b,c) end >> ^ >> 11:16:32 test_2$ >> >> Cheers >> >> robert >> > > > Hi Robert, > > I tried putting end after the last brace but didn't work. I am assuming > there is more to that ^ than just for illustrative purposes. Could you > explain to me why my code is not working? THanks! > > In Ruby, formal parameters have a particular order: def s(required, default="default", *variable_args, &block) You cannot have a regular required parameter after an optional parameter (denoted by *). The only thing you can have is a block parameter (denoted by &) or nothing at all. -Justin