Issue #7226 has been updated by Akinori MUSHA.

Status changed from Assigned to Rejected

The proposed implementation is far from efficient, collecting all elements into a temporary array only for calling Array#join.

It wouldn't be worth having it unless it went something like this: inject(nil) { |s, o| s.nil? ? "#{o}" : s << "#{sep}#{o}"m } || ''

In any case, the method would better be implemented in Enumerable rather than in Set, because it would not be specific to Set at all but apply to any class that implements each, and Set is an unordered collection you shouldn't expect to have #join in the first place.

----------------------------------------
Feature #7226: Add Set#join method as a shortcut for to_a.join
https://bugs.ruby-lang.org/issues/7226#change-46897

* Author: Nathan Broadbent
* Status: Rejected
* Priority: Normal
* Assignee: Akinori MUSHA
* Category: lib
* Target version: next minor
----------------------------------------
I was surprised that `Set.new.join` gives me a NoMethodError. 
This patch that adds a #join method to Set, which is a shortcut for `to_a.join`.


---Files--------------------------------
add_join_to_set.patch (788 Bytes)
add_join_to_set.patch (756 Bytes)


-- 
https://bugs.ruby-lang.org/