Hi,

	I've been reading through ToDo document and stuff like Warn(ing)
	interface and Ruby module with VERSION seems to be easy things
	to do.

	So here it is. (Take it as start of discussion.)

		Michal

PS: What else I can pick from ToDo?


Index: ToDo
===================================================================
RCS file: /src/ruby/ToDo,v
retrieving revision 1.83
diff -u -r1.83 ToDo
--- ToDo	2002/07/26 06:12:38	1.83
+++ ToDo	2002/08/12 15:51:06
@@ -79,6 +79,9 @@
 - hash etc. should handle self referenceing array/hash
 - Array#select(n1,n2...) works like Array#indexes(n1,n2...)
 - use Mersenne Twister RNG for random.
+- deprecate Array#indexes, and Array#indices.
+? Ruby module -- Ruby::Version, Ruby::Interpreter
+? warning framework (warn, warning for Ruby level)
 * String#scanf(?)
 * Object#fmt(?)
 * Time::strptime
@@ -87,7 +90,6 @@
 * Stream or Port, abstract superclass of IO ?
 * String#{pred,prev}, String#downto
 * optional stepsize argument for succ()
-* Ruby module -- Ruby::Version, Ruby::Interpreter
 * introduce Boolean class; super of TrueClass, FalseClass
 * synchronized method - synchronized{...}, synchronized :foo, :bar
 * Array#&, Array#| to allow duplication. ???
@@ -95,13 +97,11 @@
 * or raise ForkException to every thread but fork caller.
 * new user-defined marshal scheme. _dump(dumper), _load(restorer)
 * library to load per-user profile seeking .ruby_profile or ruby.ini file.
-* warning framework (warn, warning for Ruby level)
 * marshal should not depend on sprintf (works bad with locale).
 * ternary arg pow: a.pow(b,c) == a**b%c
 * new caller(), e.g. call_stack; needs better name.
 * remove dependency on MAXPATHLEN.
 * pointer share mechanism similar to one in String for Array.
-* deprecate Array#indexes, and Array#indices.
 * require "1.6" etc. by /usr/lib/ruby/1.6/1.6.rb ;-)
 * save both "feature names" and "normalized path" in $"
 
@@ -114,7 +114,7 @@
 
 Ruby Libraries
 
-* add uri.rb
+- add uri.rb
 * urllib.rb, nttplib.rb, etc.
 * format like perl's
 
Index: inits.c
===================================================================
RCS file: /src/ruby/inits.c,v
retrieving revision 1.6
diff -u -r1.6 inits.c
--- inits.c	2002/04/18 08:46:18	1.6
+++ inits.c	2002/08/12 15:51:07
@@ -43,6 +43,7 @@
 void Init_Time _((void));
 void Init_var_tables _((void));
 void Init_version _((void));
+void Init_Ruby _((void));
 
 void
 rb_call_inits()
@@ -77,4 +78,5 @@
     Init_GC();
     Init_marshal();
     Init_version();
+    Init_Ruby();
 }
Index: ruby.h
===================================================================
RCS file: /src/ruby/ruby.h,v
retrieving revision 1.66
diff -u -r1.66 ruby.h
--- ruby.h	2002/05/14 06:22:26	1.66
+++ ruby.h	2002/08/12 15:51:10
@@ -547,6 +547,7 @@
 EXTERN VALUE rb_mGC;
 EXTERN VALUE rb_mMath;
 EXTERN VALUE rb_mProcess;
+EXTERN VALUE rb_mRuby;
 
 EXTERN VALUE rb_cObject;
 EXTERN VALUE rb_cArray;
Index: version.c
===================================================================
RCS file: /src/ruby/version.c,v
retrieving revision 1.7
diff -u -r1.7 version.c
--- version.c	2002/01/11 09:18:50	1.7
+++ version.c	2002/08/12 15:51:10
@@ -31,6 +31,41 @@
     rb_define_global_const("PLATFORM", p);
 }
 
+static VALUE
+ruby_warn(dummy, str)
+    VALUE dummy, str;
+{
+    rb_warn("%s", StringValuePtr(str));
+    return Qnil;
+}
+
+static VALUE
+ruby_warning(dummy, str)
+    VALUE dummy, str;
+{
+    rb_warning("%s", StringValuePtr(str));
+    return Qnil;
+}
+
+VALUE rb_mRuby;
+
+void
+Init_Ruby()
+{
+    VALUE v = rb_obj_freeze(rb_str_new2(RUBY_VERSION));
+    VALUE d = rb_obj_freeze(rb_str_new2(RUBY_RELEASE_DATE));
+    VALUE p = rb_obj_freeze(rb_str_new2(RUBY_PLATFORM));
+
+    rb_mRuby = rb_define_module("Ruby");
+
+    rb_define_const(rb_mRuby, "VERSION", v);
+    rb_define_const(rb_mRuby, "RELEASE_DATE", d);
+    rb_define_const(rb_mRuby, "PLATFORM", p);
+
+    rb_define_module_function(rb_mRuby, "warn", ruby_warn, 1);
+    rb_define_module_function(rb_mRuby, "warning", ruby_warning, 1);
+}
+
 void
 ruby_show_version()
 {
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michal Rokos                         Czech Technical University, Prague
E-mail:m.rokos / sh.cvut.cz      ICQ:36118339      Jabber:majkl / jabber.cz
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-