[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: ENV.clear
From:       matz () ruby-lang ! org (Yukihiro Matsumoto)
Date:       2002-12-31 8:23:55
[Download RAW message or body]

Hi,

In message "ENV.clear"
    on 02/12/31, TOTO <zhoujing@comp.nus.edu.sg> writes:

|ENV.clear
|
|But it doesn't work, with the error message:
|../env.rb:56: undefined method `clear' for #<Object:0x401d0d28> (NameError)
|
|I thought ENV is a Hash, so clear is defined. However, when I tried:
|puts ENV.type
|
|it turns out ENV is only an Object.
|
|
|However, the Hash function delete(key) is defined for ENV. That is very strange.
|
|Can someone experienced tell me what ENV is?

ENV is an object that provides Hash-like singleton methods to work as
if it's a String-key hash.

							matz.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic