Project

General

Profile

Actions

Bug #1030

closed

Path to enumerator.so in $LOADED_PATH isn't expanded

Added by radarek (Radosław Bułat) over 16 years ago. Updated about 14 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
Backport:
[ruby-core:21468]

Description

=begin
According to NEWS file all path in $LOADED_PATH should be expanded but it looks like they aren't (at least for one ruby extension).

$ ruby1.9.1 -v && ruby1.9.1 -e 'p $".find_all {|p| p !~ /^//}'
ruby 1.9.1p0 (2009-01-20 revision 21697) [x86_64-linux]
["enumerator.so"]

$ ruby-trunk -v && ruby-trunk -e 'p $".find_all {|p| p !~ /^//}'
ruby 1.9.1p5000 (2009-01-20 trunk 21699) [x86_64-linux]
["enumerator.so"]
=end

Actions #1

Updated by nobu (Nobuyoshi Nakada) over 16 years ago

=begin
Hi,

At Wed, 21 Jan 2009 02:03:55 +0900,
Radosław Bułat wrote in [ruby-core:21468]:

According to NEWS file all path in $LOADED_PATH should be
expanded but it looks like they aren't (at least for one ruby
extension).

$ ruby1.9.1 -v && ruby1.9.1 -e 'p $".find_all {|p| p !~ /^//}'
ruby 1.9.1p0 (2009-01-20 revision 21697) [x86_64-linux]
["enumerator.so"]

It's set for backward compatibility since Enumerator is now
a builtin class. Therefore it can't have path.

--
Nobu Nakada

=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) over 16 years ago

  • Status changed from Open to Rejected

=begin

=end

Actions #3

Updated by radarek (Radosław Bułat) over 16 years ago

=begin
Oh, I see. Could you explain why 'enumerator.so' is need in $" (I wrongly wrote it as $LOADED_PATH, it should be $LOADED_FEATURES)? If it's to not broke code like

require "enumerator"

maybe you could build "dummy" enumerator.so file to do nothing or somehow hidden it from $"? I think that it could be confusing that "enumerator.so" file doesn't exists and that it's only one path in $" which is not expanded. Most users will be confused with that distinction. Ruby needs consistency, even in such a "simple" things. Please, please consider my suggestion.

Thanks.
=end

Actions #4

Updated by radarek (Radosław Bułat) over 16 years ago

=begin
I have another argument:

$ ~/opt/bin/ruby1.9-trunk -e 'p $".reject {|p| File.exist?(p) }'

I'm pretty sure that most programmers expect that all files from $" should exists (if they didn't manually modify $" variable). If you still don't want to change it I suggest to removed sentence "Elements in $LOAD_PATH and $LOADED_FEATURES are expanded" from ruby_1_9_1 branch NEWS file because it's not true.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0