[#81492] [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — normalperson@...

Issue #13618 has been reported by normalperson (Eric Wong).

12 messages 2017/06/01

[ruby-core:81755] [Ruby trunk Feature#13676] to_s method is not overriden for Set

From: marat.chardymov@...
Date: 2017-06-23 13:47:18 UTC
List: ruby-core #81755
Issue #13676 has been updated by razor (Marat Chardymov).


nobu (Nobuyoshi Nakada) wrote:
> What do you want to do?
> If you want a list of the elements, use `to_a`.
> If you want to see what elements it has, use `inspect`.

I'm printing several sets in my erb. It would be nice have such **to_s** behaviour by default, eliminating the need to call **to_a** on each of them

----------------------------------------
Feature #13676: to_s method is not overriden for Set
https://bugs.ruby-lang.org/issues/13676#change-65452

* Author: razor (Marat Chardymov)
* Status: Feedback
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
When I call

~~~ ruby
s1 = Set.new
s1<<'tic'<<'tac'
s1.to_s
~~~

I'd expect ['tic', 'tac'] values being printed, not "#<Set:0x0055f331076348>"




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

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next