Feature #5970

Add Enumerable#join with same semantics as Array#join

Added by Nikolai Weibull over 3 years ago. Updated over 2 years ago.

[ruby-core:42357]
Status:Assigned
Priority:Normal
Assignee:Yukihiro Matsumoto

Description

Currently, to join the elements of an Enumerable, you need to call #to_a on the Enumerable and then #join the result. With Enumerable#join one wouldn’t need need to create an intermediate Array.

enumerable_join.patch Magnifier (5.42 KB) Zachary Scott, 11/19/2012 08:26 AM


Related issues

Duplicated by Ruby trunk - Feature #7226: Add Set#join method as a shortcut for to_a.join Rejected 10/28/2012

History

#1 Updated by Yusuke Endoh over 3 years ago

  • Status changed from Open to Assigned
  • Assignee set to Yukihiro Matsumoto

#2 Updated by Shugo Maeda over 3 years ago

now (Nikolai Weibull) wrote:

Currently, to join the elements of an Enumerable, you need to call #to_a on the Enumerable and then #join the result. With Enumerable#join one wouldn’t need need to create an intermediate Array.

Once Enumerable#join had been added, and was removed later. See Bug #1893 ().

#3 Updated by Shugo Maeda almost 3 years ago

  • Target version changed from 2.0.0 to next minor

#4 Updated by Zachary Scott over 2 years ago

Adding Greg Sterndale's patch from github:
https://github.com/ruby/ruby/pull/97

Also available in: Atom PDF