From: Lloyd Zusman Date: 2001-04-01T04:10:05+09:00 Subject: [ruby-talk:13393] Re: Passing an array to `exec'? "Brian F. Feldman" writes: > Lloyd Zusman wrote: > > > > [ ... ] > > > > The above example shows `*' being used within a method definition, > > not a method invocation, and I'd like to understand the exact > > meaning of `*' when used this way in the argument list of a *call* > > to a method. [ ... ] > > > > [ ... ] > > > > Thanks to all of you for your help. > > Yep, that's exactly what it means. Actually, it can happen in any > one of several contexts, but the most important one is that it > "flattens" an Array out into method arguments, just like you want. > > E.g., try this: > > [ ... ] > > $stdout.mysend(:puts, > "Using * and & forms in the method definition coerces the > argument list past that point or the block given > (respectively) into a single variable. Using them in > a method call reverses this coercion, transforming > *args into a parameter list and &block into a normal block.", "See?") {} Yes, now it's perfectly clear. Thank you very much. > -- > Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / > green@FreeBSD.org `------------------------------' -- Lloyd Zusman ljz@asfast.com