Project

General

Profile

Feature #5970

Add Enumerable#join with same semantics as Array#join

Added by Nikolai Weibull almost 5 years ago. Updated about 4 years ago.

Status:
Assigned
Priority:
Normal
[ruby-core:42357]

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 View (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 [ruby-core:43877] Updated by Yusuke Endoh over 4 years ago

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

#2 [ruby-core:43932] Updated by Shugo Maeda over 4 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 [ruby-core:48513] Updated by Shugo Maeda about 4 years ago

  • Target version changed from 2.0.0 to next minor

#4 [ruby-core:49541] Updated by Zachary Scott about 4 years ago

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

Also available in: Atom PDF