Project

General

Profile

Actions

Bug #6159

closed

Enumerable::Lazy#inspect

Added by Eregon (Benoit Daloze) almost 13 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.0.0dev (2012-03-15 trunk 35042) [x86_64-darwin10.8.0]
Backport:
[ruby-core:43345]

Description

Hello,

Enumerable::Lazy#inspect is undefined right now and relies on Enumerator#inspect:

(1..5).lazy # => #<Enumerator::Lazy: #<Enumerator::Generator:0x00000101a2f9e8>:each>

I think it would be nice to be similar to (direct) Enumerator#inspect:

(1..5).each # => #<Enumerator: 1..5:each>

So something like: #<Enumerator::Lazy: 1..5:each> or #<Enumerator::Lazy: #<Enumerator: 1..5:each>>

It would also be nice to show the chaining, like Enumerator does:

(1..5).select.map.flat_map # => #<Enumerator: #<Enumerator: #<Enumerator: 1..5:select>:map>:flat_map> 

What do you think?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0