diff --git a/ChangeLog b/ChangeLog index f52711330b..a7b5de3600 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Sun Apr 4 20:33:42 2004 Minero Aoki + + * eval.c (Init_load): make $LOADED_FEATURES built-in. + [ruby-dev:23299] + + * ruby.c (ruby_prog_init): make $PROGRAM_NAME built-in. + + * lib/English.rb: remove $LOADED_FEATURES and $PROGRAM_NAME. + Sun Apr 4 14:01:20 2004 Dave Thomas * lib/rdoc/options.rb (Options::parse): Allow multiple -x options to RDoc. diff --git a/eval.c b/eval.c index a88839eb3a..b24312e8bc 100644 --- a/eval.c +++ b/eval.c @@ -7684,6 +7684,7 @@ Init_load() rb_features = rb_ary_new(); rb_define_readonly_variable("$\"", &rb_features); + rb_define_readonly_variable("$LOADED_FEATURES", &rb_features); rb_define_global_function("load", rb_f_load, -1); rb_define_global_function("require", rb_f_require, 1); diff --git a/lib/English.rb b/lib/English.rb index 4b859d96f6..1a0e11de74 100644 --- a/lib/English.rb +++ b/lib/English.rb @@ -24,9 +24,6 @@ alias $ERROR_INFO $! # exception. See Kernel.caller for details. Thread local. alias $ERROR_POSITION $@ -# An array containing the filenames of modules loaded by +require+. -alias $LOADED_FEATURES $" - # The default separator pattern used by String.split. May be # set from the command line using the -F flag. alias $FS $; @@ -130,12 +127,6 @@ alias $LAST_MATCH_INFO $~ # string hash values will be case insensitive. Deprecated alias $IGNORECASE $= -# The name of the top-level Ruby program being executed. Typically -# this will be the program's filename. On some operating systems, -# assigning to this variable will change the name of the process -# reported (for example) by the ps(1) command. -alias $PROGRAM_NAME $0 - # An array of strings containing the command-line # options from the invocation of the program. Options # used by the Ruby interpreter will have been diff --git a/ruby.c b/ruby.c index afe1e71ae8..f2d368d8b5 100644 --- a/ruby.c +++ b/ruby.c @@ -1063,6 +1063,7 @@ ruby_prog_init() rb_define_readonly_variable("$-l", &do_line); rb_define_hooked_variable("$0", &rb_progname, 0, set_arg0); + rb_define_hooked_variable("$PROGRAM_NAME", &rb_progname, 0, set_arg0); rb_argv = rb_ary_new(); rb_define_readonly_variable("$*", &rb_argv);