From: Mark Volkmann Date: 2006-02-05T09:43:57+09:00 Subject: Re: built-in vs. standard library On 2/4/06, Ross Bamford wrote: > On Sat, 04 Feb 2006 23:23:36 -0000, Mark Volkmann > wrote: > > > On 2/4/06, James Edward Gray II wrote: > >> On Feb 4, 2006, at 2:57 PM, Mark Volkmann wrote: > >> > >> > I'm confused about whether the Date class is built-in or in the > >> > standard library. > >> > >> It's a standard library. > >> > >> > I can use it without requiring it in irb, so that tells me it's > >> > built-in. > >> > >> Na, that tells you that irb requires it somewhere. :) > > > > Then why does this code run? > > > > d = Date.new > > puts "d is a #{d.class}" > > > > This is telling me that there is a built-in Date class and there is > > another one in the Standard Library. > > > > Just curious, what is your output from this code? > > p 1 if defined? Date > require 'irb' > p 2 if defined? Date > require 'rubygems' > p 3 if defined? Date I get 1 2 3 > I just get 3 (which I think is expected). Do you require rubygems in your > ..irbrc? or $RUBYOPTS? I'm running Ruby 1.8.4 under Windows XP. I don't have a RUBYOPTS environment variable set and I get the result above when I put the code in a file and run it with "ruby myfile.rb", so I guess the .irbrc part doesn't matter. -- R. Mark Volkmann Partner, Object Computing, Inc.