On Sat, 19 Feb 2005 17:59:55 +0100, Simon Strandgaard <neoneye / gmail.com> wrote:
[snip]
> Maybe better to name it  #interleave, like this
> 
> [1, 2, 3, 4, 5, 6].interleave(0)    #-> [1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6]
> [1, 2, 3, 4, 5, 6].interleave('hi')    #-> [1, 'hi', 2, 'hi', 3, 'hi', 4, 'hi', 5, 'hi', 6]


Jannis Harder suggested to let #interleave take a block, like this:

[8,6,4,2,0].interleave{|a,b|(a+b)/2}  #-> [8,7,6,5,4,3,2,1,0] 


--
Simon Strandgaard