in reply to Re: Functional shuffle
in thread Functional shuffle
which is, I think, something of an improvement as well. Splicing the only element out of an array is certainly valid.sub functional_FY { return @_ ? ( splice( @_, rand @_, 1 ), &functional_FY ) : @_; }
Update: A functional splice, though, shouldn't have side-effects. It would either retrieve the values, or return the array without them. Or you could make one that sticks them on the front, maybe. I pronounce it a good start.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Functional shuffle
by bart (Canon) on Apr 02, 2005 at 11:56 UTC | |
by tlm (Prior) on Apr 02, 2005 at 16:11 UTC | |
by Roy Johnson (Monsignor) on Apr 04, 2005 at 14:01 UTC | |
|
Re^3: Functional shuffle
by kelan (Deacon) on Apr 02, 2005 at 14:04 UTC |