Feature #5970

Add Enumerable#join with same semantics as Array#join

Added by Nikolai Weibull about 2 years ago. Updated over 1 year ago.

[ruby-core:42357]
Status:Assigned
Priority:Normal
Assignee:Yukihiro Matsumoto
Category:core
Target version:next minor

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: Added #join method as a shortcut for to_a.join Open 10/28/2012

History

#1 Updated by Yusuke Endoh about 2 years ago

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

#2 Updated by Shugo Maeda about 2 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 over 1 year ago

  • Target version changed from 2.0.0 to next minor

#4 Updated by Zachary Scott over 1 year ago

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

Also available in: Atom PDF