ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:25200] [Bug #2018] [irb] BasicObject.new doesn't have an inspect
@ 2009-08-30 17:43 Daniel Bovensiepen
  2009-08-30 17:49 ` [ruby-core:25201] " David A. Black
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Bovensiepen @ 2009-08-30 17:43 UTC (permalink / raw
  To: ruby-core

Bug #2018: [irb] BasicObject.new doesn't have an inspect
http://redmine.ruby-lang.org/issues/show/2018

Author: Daniel Bovensiepen
Status: Open, Priority: Low
Category: lib
ruby -v: ruby 1.9.2dev (2009-08-30 trunk 24718) [i386-darwin9.8.0]

Using BasicObject.new in irb:

   daniel@boviAir# ruby19 --version
   ruby 1.9.2dev (2009-08-30 trunk 24718) [i386-darwin9.8.0]
   daniel@boviAir# irb19 --version
   irb 0.9.6(09/06/30)
   daniel@boviAir# irb19
   irb(main):001:0> BasicObject.new

Produce an Exception due to the fact that inspect doesn't exist in the BasicObject:

NoMethodError: undefined method `inspect' for #<BasicObject:0x4b2738>
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/inspector.rb:84:in `block in <module:IRB>'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/inspector.rb:30:in `call'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/inspector.rb:30:in `inspect_value'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/context.rb:259:in `inspect_last_value'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:309:in `output_value'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:158:in `block (2 levels) in eval_input'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:271:in `signal_status'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:154:in `block in eval_input'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/ruby-lex.rb:244:in `block (2 levels) in each_top_level_statement'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/ruby-lex.rb:230:in `loop'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/ruby-lex.rb:230:in `block in each_top_level_statement'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `catch'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `each_top_level_statement'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:153:in `eval_input'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:70:in `block in start'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:69:in `catch'
        from /Users/danielbovensiepen/Programs/ruby19/lib/ruby/1.9.1/irb.rb:69:in `start'
        from /Users/danielbovensiepen/Programs/ruby19/bin/irb19:12:in `<main>'Maybe IRB bug!!

In the attachment is a patch for catching this exception.


----------------------------------------
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:25201] Re: [Bug #2018] [irb] BasicObject.new doesn't have an inspect
  2009-08-30 17:43 [ruby-core:25200] [Bug #2018] [irb] BasicObject.new doesn't have an inspect Daniel Bovensiepen
@ 2009-08-30 17:49 ` David A. Black
  2009-08-30 17:51   ` [ruby-core:25202] " Hongli Lai
  2009-08-30 22:35   ` [ruby-core:25206] " Yukihiro Matsumoto
  0 siblings, 2 replies; 7+ messages in thread
From: David A. Black @ 2009-08-30 17:49 UTC (permalink / raw
  To: ruby-core

Hi --

On Mon, 31 Aug 2009, Daniel Bovensiepen wrote:

> Bug #2018: [irb] BasicObject.new doesn't have an inspect
> http://redmine.ruby-lang.org/issues/show/2018

Why is that a bug?


David

-- 
David A. Black / Ruby Power and Light, LLC / http://www.rubypal.com
Ruby/Rails training, mentoring, consulting, code-review
Latest book: The Well-Grounded Rubyist (http://www.manning.com/black2)

September Ruby training in NJ has been POSTPONED. Details to follow.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:25202] [Bug #2018] [irb] BasicObject.new doesn't have an inspect
  2009-08-30 17:49 ` [ruby-core:25201] " David A. Black
@ 2009-08-30 17:51   ` Hongli Lai
  2009-08-30 22:35   ` [ruby-core:25206] " Yukihiro Matsumoto
  1 sibling, 0 replies; 7+ messages in thread
From: Hongli Lai @ 2009-08-30 17:51 UTC (permalink / raw
  To: ruby-core

Issue #2018 has been updated by Hongli Lai.


I thought the whole point of BasicObject is that it doesn't have any methods.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2018

----------------------------------------
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:25206] Re: [Bug #2018] [irb] BasicObject.new doesn't have an inspect
  2009-08-30 17:49 ` [ruby-core:25201] " David A. Black
  2009-08-30 17:51   ` [ruby-core:25202] " Hongli Lai
@ 2009-08-30 22:35   ` Yukihiro Matsumoto
  2009-08-30 22:40     ` [ruby-core:25207] " David A. Black
  1 sibling, 1 reply; 7+ messages in thread
From: Yukihiro Matsumoto @ 2009-08-30 22:35 UTC (permalink / raw
  To: ruby-core

Hi,

In message "Re: [ruby-core:25201] Re: [Bug #2018] [irb] BasicObject.new doesn't have an inspect"
    on Mon, 31 Aug 2009 02:49:19 +0900, "David A. Black" <dblack@rubypal.com> writes:

|> Bug #2018: [irb] BasicObject.new doesn't have an inspect
|> http://redmine.ruby-lang.org/issues/show/2018
|
|Why is that a bug?

I think it's not the point.  BasicObject has no method (with a few
exception) by its definition.  But irb should handle objects without
inspect defined.

							matz.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:25207] Re: [Bug #2018] [irb] BasicObject.new doesn't have an inspect
  2009-08-30 22:35   ` [ruby-core:25206] " Yukihiro Matsumoto
@ 2009-08-30 22:40     ` David A. Black
  2009-09-07  2:35       ` [ruby-core:25447] [Feature " Yuki Sonoda
  2009-09-07  3:37       ` [ruby-core:25448] [Feature #2018](Closed) " Yukihiro Matsumoto
  0 siblings, 2 replies; 7+ messages in thread
From: David A. Black @ 2009-08-30 22:40 UTC (permalink / raw
  To: ruby-core

On Mon, 31 Aug 2009, Yukihiro Matsumoto wrote:

> Hi,
>
> In message "Re: [ruby-core:25201] Re: [Bug #2018] [irb] BasicObject.new doesn't have an inspect"
>    on Mon, 31 Aug 2009 02:49:19 +0900, "David A. Black" <dblack@rubypal.com> writes:
>
> |> Bug #2018: [irb] BasicObject.new doesn't have an inspect
> |> http://redmine.ruby-lang.org/issues/show/2018
> |
> |Why is that a bug?
>
> I think it's not the point.  BasicObject has no method (with a few
> exception) by its definition.  But irb should handle objects without
> inspect defined.

Ah, OK -- I didn't catch onto that.

Actually I really like doing:

   >> b = BasicObject.new

in irb when I'm teaching 1.9 -- very dramatic way to demonstrate the
basicness of BasicObject :-) But I can understand that it should
probably be handled more gracefully.


David

-- 
David A. Black / Ruby Power and Light, LLC / http://www.rubypal.com
Ruby/Rails training, mentoring, consulting, code-review
Latest book: The Well-Grounded Rubyist (http://www.manning.com/black2)

September Ruby training in NJ has been POSTPONED. Details to follow.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:25447] [Feature #2018] [irb] BasicObject.new doesn't have an inspect
  2009-08-30 22:40     ` [ruby-core:25207] " David A. Black
@ 2009-09-07  2:35       ` Yuki Sonoda
  2009-09-07  3:37       ` [ruby-core:25448] [Feature #2018](Closed) " Yukihiro Matsumoto
  1 sibling, 0 replies; 7+ messages in thread
From: Yuki Sonoda @ 2009-09-07  2:35 UTC (permalink / raw
  To: ruby-core

Issue #2018 has been updated by Yuki Sonoda.

Assigned to set to Keiju Ishitsuka
Target version set to 1.9.x

It is not a bug. But I think enhancement for irb is possible. 
What kind of handling do you want?
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2018

----------------------------------------
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:25448] [Feature #2018](Closed) [irb] BasicObject.new doesn't have an inspect
  2009-08-30 22:40     ` [ruby-core:25207] " David A. Black
  2009-09-07  2:35       ` [ruby-core:25447] [Feature " Yuki Sonoda
@ 2009-09-07  3:37       ` Yukihiro Matsumoto
  1 sibling, 0 replies; 7+ messages in thread
From: Yukihiro Matsumoto @ 2009-09-07  3:37 UTC (permalink / raw
  To: ruby-core

Issue #2018 has been updated by Yukihiro Matsumoto.

Status changed from Open to Closed
% Done changed from 0 to 100

Applied in changeset r24779.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2018

----------------------------------------
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-07  3:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-30 17:43 [ruby-core:25200] [Bug #2018] [irb] BasicObject.new doesn't have an inspect Daniel Bovensiepen
2009-08-30 17:49 ` [ruby-core:25201] " David A. Black
2009-08-30 17:51   ` [ruby-core:25202] " Hongli Lai
2009-08-30 22:35   ` [ruby-core:25206] " Yukihiro Matsumoto
2009-08-30 22:40     ` [ruby-core:25207] " David A. Black
2009-09-07  2:35       ` [ruby-core:25447] [Feature " Yuki Sonoda
2009-09-07  3:37       ` [ruby-core:25448] [Feature #2018](Closed) " Yukihiro Matsumoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).