[#1551] Hashes as keys — "Nathaniel Talbott" <nathaniel@...>

I was just playing around with Hash#hash and discovered that you can't use a

13 messages 2003/09/23

[bug] Silent death of "ruby -e"

From: Johan Holmberg <holmberg@...>
Date: 2003-09-05 10:43:36 UTC
List: ruby-core #1518
Hi !

I've found a weird bug. It can occur when running Ruby 1.8 with the
"-e" option on Windows. Like this:

   $ ruby -e 'puts foo'
   -e:1: undefined local variable or method `foo' for main:Object (NameError)
   $
   $ ruby -e 'puts foo[1]'
   -e:1: undefined local variable or method `foo' for main:Object (NameError)
   $
 * $ ruby -e 'puts foo["a"]'
   $
   $ ruby -e 'puts foo["a"] ; puts "never-written"'
   -e:1: undefined local variable or method `foo' for main:Object (NameError)
   $

I think that the third line above (marked with a *) should have
given an error too.

I tried to track this down myself, but got lost in the debugger ...

/Johan Holmberg


In This Thread

Prev Next