I wrote a pure Ruby implementation of interpolate (was: interleave)
(Simon Strandgaard and I decided interpolate fits better)

1 argument, without block:
[1, 2, 3, 4].interpolate("a") #=> [1, "a", 2, "a", 3, "a", 4]

2+ arguments, without block:
[1, 2, 3, 4, 5].interpolate("a","b","c") #=> [1, "a", 2, "b", 3, "c", 4, 
"a", 5]

no arguments, with block:
[0, 10, 100, 1000].interpolate{|a,b,index|"#{(a+b)/2} #{index}"}
#=> [0, "5 0", 10, "55 1", 100, "550 2", 1000]

with arguments and block:
[0, 10, 100, 1000, 
10000].interpolate(+1,-1){|sign,a,b,index|"#{(a+b)/2*sign} #{index}"}
#=> [0, "5 0", 10, "-55 1", 100, "550 2", 1000, "-5500 3", 10000]

http://www.harderweb.de/jannis/ruby/interpolate.rb

--
Jannis Harder