On Mon, Sep 20, 2004 at 03:11:47PM +0900, James Britt wrote:
> Mehr, Assaph (Assaph) wrote:
> >>Why?  Speed?  I imagine that, in both cases, a string could have been 
> >>used as well.  A string, though, would let you craft an invalid method
[...]
> >That's evil, but apparently legal:
> 
> Evil, you say?
> 
> Think of the possibilities ...

>> class << self; define_method("foo\0evil"){ puts "foo" } end
=> #<Proc:0x401fe928@(irb):1>
>> send("foo\0evil")
foo
=> nil
>> class << self; instance_methods(false) end.sort.grep(/foo/)
=> ["foo"]

Not evil anymore :)

-- 
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com