From: Robert Klemme Date: 2005-09-28T21:26:43+09:00 Subject: Re: [REXML] Wierd behaviour with Date Damphyr wrote: > Robert Klemme wrote: >> You should not include REXML: >> >> 12:17:39 [ruby]: ruby -r date -e 'p Date.object_id; require >> "rexml/document"; p Date.object_id; class X; include REXML; p >> Date.object_id; end' 135087764 135087764 135679456 12:17:51 [ruby]: >> >> Notice the different last id? > Well, I figuredd that out and I run my code without the include, but > the question remains, what does REXML do to Date? IMHO REXML is not intended for inclusion it's just a namespace module. If you import it you get all sorts of stuff inside that module into your class. By importing it you create the effect that the namespace was introduced to avoid. > 'Should not include REXML when using Date' is not something that one > expects, is it? > Anyway, can I call Date instead of REXML::Date? ::Date 14:23:55 [ruby]: ruby -r date -e 'p Date.object_id; require "rexml/document"; p Date.object_id; class X; include REXML; p Date.object_id; p ::Date.ob ject_id; end' 135087828 135087828 135677044 135087828 Kind regards robert