On Fri, 28 Mar 2003 7:37 pm, Daniel Carrera wrote:
> Uh, no it doesn't strike me as what 'join' is supposed to do.
> Intuitively, I think that a 'join' function should only join the entries
> of the array and not modify the entries themselves.

I would agree - otherwise you're combining the functionality of 'join' with 
'collect'. What might be useful is for join to take a block which decides 
what separator to use based on the value of the previous item, eg:
  (1..10).to_a.join { |i|
    i % 2 == 0 ? " " : "-"
  } # => "1-2 3-4 5-6 7-8 9-10"
This is a trivial example, and I can't think of a real example off the top of 
my head, so feel free to reject it on the grounds that it may not be useful, 
but this just occurred to me and I thought I'd throw it out there...

Tim Bates
-- 
tim / bates.id.au