[#290] — Florian Frank <flori@...>
Hi all,
5 messages
2002/08/03
[#297] GC longjmp macros — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/05
[#308] Q: OSSL in std. distr? — Michal Rokos <m.rokos@...>
Hi,
4 messages
2002/08/08
[#326] Implications of a #force_free method in Object? — Matthew Bloch <mattbee@...>
Hello;
8 messages
2002/08/19
[#328] Int vs Long — Michal Rokos <m.rokos@...>
Hi,
7 messages
2002/08/21
[#337] Int vs Long (2nd part) — Michal Rokos <m.rokos@...>
Hi,
7 messages
2002/08/22
[#340] Int vs Long #3 — Michal Rokos <m.rokos@...>
Hi,
9 messages
2002/08/22
[#344] Re: [Cleanup] Int vs Long #3
— nobu.nokada@...
2002/08/22
Hi,
[#348] Re: [Cleanup] Int vs Long #3
— Michal Rokos <m.rokos@...>
2002/08/23
Hello,
[#353] File (struct stat handling) — Michal Rokos <m.rokos@...>
Hello,
6 messages
2002/08/23
[#358] node.h for eval.c — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/23
[#372] rb_class_path — Michal Rokos <m.rokos@...>
Hello,
7 messages
2002/08/27
[#382] Port match to new dup, clone framework — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/28
[#393] in dln.c — Michal Rokos <m.rokos@...>
Hi,
14 messages
2002/08/30
[#398] Re: [MemLeak] in dln.c
— nobu.nokada@...
2002/08/31
Hi,
[#403] Re: [MemLeak] in dln.c
— Michal Rokos <m.rokos@...>
2002/09/02
Hello,
[ToDo] Ruby module, Warn(ing) interface
From:
Michal Rokos <m.rokos@...>
Date:
2002-08-12 15:55:35 UTC
List:
ruby-core #321
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
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-