[#36686] 1.1 < 61.1 - 60.0 — Shin-ichiro HARA <sinara@...>

原です。

19 messages 2002/12/06

[#36770] www.ruby-lang.orgリニューアル準備のお知らせ — TADA Tadashi <sho@...>

ruby-lang.orgのwebmasterチームでは、タイムリーな情報提供と使いやすい

11 messages 2002/12/16

[ruby-list:36688] Re: SyntaxError caused by redefinition of Class#== within irb.

From: Shusaku <tsyk@...>
Date: 2002-12-06 05:16:46 UTC
List: ruby-list #36688
On Fri, 6 Dec 2002 02:12:02 +0900
matz@ruby-lang.org (Yukihiro Matsumoto) wrote:

> |おそらく irb ゆえの制限だと思いますが、回避方法はありますか?
> 
> 全部一行で書く。
> 
> irb(main):003:1> def ==(other);....;end
> 

irb(main):001:0> class Foo; def ==(other); super(other); end; end
=> nil
irb(main):002:0> class Foo
irb(main):003:1>   def ==(other); super(other); end
SyntaxError: compile error
(irb):3: syntax error
        from (irb):3
irb(main):004:0> 

うーん、class ... end も含めて本当にに全部一行で書くしかないみたい…

-- 
Shusaku <tsyk@yk.rim.or.jp>


In This Thread