From: Joao Pedrosa Date: 2005-01-30T16:02:17+09:00 Subject: Re: Ten Things Every Java Programmer Should Know About Ruby Hi, On Sun, 30 Jan 2005 14:59:23 +0900, Navindra Umanee wrote: > Joao Pedrosa wrote: > > > An object in Ruby may even change its type from one moment to the > > > other. A Socket object may suddenly become a File object. It's documented: ------------------------ ri reopen ----------------------- -------------------------------------------------------------- IO#reopen ios.reopen(other_IO) => ios ios.reopen(path, mode_str) => ios ------------------------------------------------------------------------ Reassociates _ios_ with the I/O stream given in _other_IO_ or to a new stream opened on _path_. This may dynamically change the actual class of this stream. f1 = File.new("testfile") f2 = File.new("testfile") f2.readlines[0] #=> "This is line one\n" f2.reopen(f1) #=> # f2.readlines[0] #=> "This is line one\n" ------------------------ ri reopen ----------------------- Well, it *is* documented. No surprise here. Regards, Joao