[BUG?] irb and /

Hi,

The following is some tests on ‘/’

irb 0.7.4

irb(main):001:0> a = 10
=> 10
irb(main):002:0> b = a /2
irb(main):003:0/
irb(main):004:0/ /
NameError: undefined method `a' for #<Object:0x2ac38ce0>
        from (irb):4
irb(main):005:0>

irb 0.9

irb(main):001:0> a = 10
=> 10
irb(main):002:0> b = a /2
irb(main):003:0/
irb(main):004:0/ /
SyntaxError: compile error
(irb):4: unterminated string meets end of file
(irb):4: syntax error
        from (irb):4
irb(main):005:0>

ruby 1.6.8 script

a = 10
b = a /2     #==> unterminated regexp meets end of file


a = 10
b = a /2 / 3 #==> parse error

Bug or feature?

Park Heesob

Consequence. I long ago forgot why, but you must write either

x / y

or

x/y
.

x /y gets parsed funny. Someone else will fill in the details.

Gavin

···

On Sunday, January 12, 2003, 7:44:47 AM, Park wrote:

The following is some tests on ‘/’

[…]
a = 10
b = a /2 / 3 #==> parse error

Bug or feature?