From: "Eregon (Benoit Daloze)" Date: 2012-03-24T20:19:55+09:00 Subject: [ruby-core:43583] [ruby-trunk - Bug #6159] Enumerable::Lazy#inspect Issue #6159 has been updated by Eregon (Benoit Daloze). > I agree that It would be nice. However, unlike Enumerator, Enumerator::Lazy doesn't have enough information, so it needs to have some information only for inspect. > Is it so important to make inspect rich? I'm not sure, but it would certainly be helpful when debugging. On the other hand, if that would impact significantly performance or code (maintainability), it's probably not worth it. I guess I'm not used to a core Ruby class without a nice #inspect. ---------------------------------------- Bug #6159: Enumerable::Lazy#inspect https://bugs.ruby-lang.org/issues/6159#change-25079 Author: Eregon (Benoit Daloze) Status: Feedback Priority: Normal Assignee: shugo (Shugo Maeda) Category: core Target version: 2.0.0 ruby -v: ruby 2.0.0dev (2012-03-15 trunk 35042) [x86_64-darwin10.8.0] Hello, Enumerable::Lazy#inspect is undefined right now and relies on Enumerator#inspect: (1..5).lazy # => #:each> I think it would be nice to be similar to (direct) Enumerator#inspect: (1..5).each # => # So something like: # or #> It would also be nice to show the chaining, like Enumerator does: (1..5).select.map.flat_map # => #:map>:flat_map> What do you think? -- http://bugs.ruby-lang.org/