ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:37756] [Ruby 1.9 - Bug #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
@ 2011-07-03 19:05 ` Thomas Sawyer
  2011-07-05 11:23   ` [ruby-core:37794] " Nikolai Weibull
  2011-07-03 22:37 ` [ruby-core:37760] " Yukihiro Matsumoto
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 16+ messages in thread
From: Thomas Sawyer @ 2011-07-03 19:05 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Thomas Sawyer.


How can this be rejected? The example I gave is a glaring problem.
----------------------------------------
Bug #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 
ruby -v: 1.9.2-p0


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:37760] [Ruby 1.9 - Bug #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
  2011-07-03 19:05 ` [ruby-core:37756] [Ruby 1.9 - Bug #3768] Constant Lookup doesn't work in a subclass of BasicObject Thomas Sawyer
@ 2011-07-03 22:37 ` Yukihiro Matsumoto
  2011-07-04  0:07 ` [ruby-core:37762] " Thomas Sawyer
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Yukihiro Matsumoto @ 2011-07-03 22:37 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Yukihiro Matsumoto.


Haven't I explained the reason?

The M is defined under the Object class.  The BasicObject does not inherit from Object.  So there's no reason M can be accessed from BasicObject, under the current behavior of constant accessing in Ruby.  If you want to "fix" this problem, how should I?  Making constants under Object can be accessed from everywhere? Or otherwise?

In any case, the "fix" would be huge change to the constant access system, and would introduce huge risk of incompatibility.

matz.
----------------------------------------
Bug #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 
ruby -v: 1.9.2-p0


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:37762] [Ruby 1.9 - Bug #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
  2011-07-03 19:05 ` [ruby-core:37756] [Ruby 1.9 - Bug #3768] Constant Lookup doesn't work in a subclass of BasicObject Thomas Sawyer
  2011-07-03 22:37 ` [ruby-core:37760] " Yukihiro Matsumoto
@ 2011-07-04  0:07 ` Thomas Sawyer
  2011-07-04  0:38 ` [ruby-core:37763] " Jeremy Evans
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Thomas Sawyer @ 2011-07-04  0:07 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Thomas Sawyer.


I am not sure that <i>a</i> fix is such a huge change. Look-up can be delegated:

  class BasicObject
    def self.const_missing(name)
      ::Object.const_get(name)
    end
  end

But yes, I think the ultimate fix does need a rework for constant lookup to terminate at toplevel instead of Object, but I can understand that's a "Ruby 2.0" kind of change. But the above may suffice in the mean time, if it doesn't present any unintended consequences (I can't think of any myself).

----------------------------------------
Bug #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 
ruby -v: 1.9.2-p0


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:37763] [Ruby 1.9 - Bug #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2011-07-04  0:07 ` [ruby-core:37762] " Thomas Sawyer
@ 2011-07-04  0:38 ` Jeremy Evans
  2011-07-04  1:48 ` [ruby-core:37764] " Thomas Sawyer
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Jeremy Evans @ 2011-07-04  0:38 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Jeremy Evans.


If BasicObject.const_missing calls Object.const_get and the constant does not exist in Object, you've at best got a SystemStackError (I got SIGILL when I tried).  I suppose this could work:

  class BasicObject
    def self.const_missing(name)
      ::Object.const_get(name) if ::Object.const_defined?(name)
    end
  end

While safer, I do not advocate such an approach.  For one, there's a TOCTOU race condition in threaded code if Object.remove_const is used.

Personally, I don't see this as a major issue.  There should be no need for this in BasicObject itself, and overriding const_missing in a BasicObject subclass is easy.
----------------------------------------
Bug #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 
ruby -v: 1.9.2-p0


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:37764] [Ruby 1.9 - Bug #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2011-07-04  0:38 ` [ruby-core:37763] " Jeremy Evans
@ 2011-07-04  1:48 ` Thomas Sawyer
  2011-07-04  2:16 ` [ruby-core:37765] " Jeremy Evans
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Thomas Sawyer @ 2011-07-04  1:48 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Thomas Sawyer.


@Jeremy The very need of it is why I reported the issue.

The behavior is clearly broken. It's a pretty fundamental expectation that a subclass of BasicObject would have working constant lookup. To think otherwise is to assert that no subclass of BasicObject should ever be allowed to use delegation.

All I can say is thank goodness for const_missing, b/c if it wasn't for that BasicObject would be all but useless and I literally would not have been able to make two of my programs work correctly (well, without defining my own sub-optimal "BlankSlate" class).

At the VERY least add the work-around to BasicObject's documentation so others will know what to do when their code doesn't work.
----------------------------------------
Bug #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 
ruby -v: 1.9.2-p0


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:37765] [Ruby 1.9 - Bug #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2011-07-04  1:48 ` [ruby-core:37764] " Thomas Sawyer
@ 2011-07-04  2:16 ` Jeremy Evans
  2011-07-04 17:34 ` [ruby-core:37786] [Ruby 1.9 - Feature " Lazaridis Ilias
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Jeremy Evans @ 2011-07-04  2:16 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Jeremy Evans.


I disagree that the behavior is "clearly broken".  Just like methods defined in Object don't apply to BasicObject, you shouldn't expect constants defined in Object to apply to BasicObject.

You assume that normal constant lookup is always desired in BasicObject subclasses.  While true in some cases, it is not necessarily true in all.  Take this simple case:

  class S < BasicObject
    def method_missing(m) m end
    def self.const_missing(m) m end
  end

Basically, the programmer desires both that both method calls and constant references return symbols:

  S.new.instance_eval{puts} # => :puts
  S.new.instance_eval{Object} # => :Object

With your approach, you would get ::Object instead of :Object for the second line.  Just like the puts method doesn't exist in BasicObject instances, the Object constant doesn't exist in BasicObject.

Your recommendation would remove the ability programmers currently have to choose how to implement constant lookup in their BasicObject subclasses. Your recommendation assumes that all users want normal constant lookup in a BasicObject subclass.  However, the fact that they are using BasicObject is an indication that they don't want normal method lookup (no methods from Object or Kernel), so I think the assumption that they definitely want normal constant lookup is invalid.

I agree that adding documentation to BasicObject related to this would be beneficial, perhaps you should submit a documentation patch?
----------------------------------------
Bug #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 
ruby -v: 1.9.2-p0


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:37786] [Ruby 1.9 - Feature #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
                   ` (5 preceding siblings ...)
  2011-07-04  2:16 ` [ruby-core:37765] " Jeremy Evans
@ 2011-07-04 17:34 ` Lazaridis Ilias
  2011-07-05 14:31 ` [ruby-core:37799] " Thomas Sawyer
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Lazaridis Ilias @ 2011-07-04 17:34 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Lazaridis Ilias.


=begin
Yukihiro Matsumoto wrote:
> This is not a bug.

The author has reported  a "bug", which was rejected. It's not necessary to change the issue type, in fact it's wrong to do so (because this remains a bug-report and not a feature request, see title).

Some more details on issue-tracking: #4963

=end

----------------------------------------
Feature #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:37794] Re: [Ruby 1.9 - Bug #3768] Constant Lookup doesn't work in a subclass of BasicObject
  2011-07-03 19:05 ` [ruby-core:37756] [Ruby 1.9 - Bug #3768] Constant Lookup doesn't work in a subclass of BasicObject Thomas Sawyer
@ 2011-07-05 11:23   ` Nikolai Weibull
  0 siblings, 0 replies; 16+ messages in thread
From: Nikolai Weibull @ 2011-07-05 11:23 UTC (permalink / raw
  To: ruby-core

On Sun, Jul 3, 2011 at 21:05, Thomas Sawyer <transfire@gmail.com> wrote:

>  ruby-1.9.2-p0 > class X < BasicObject
>  ruby-1.9.2-p0 ?>    include M
>  ruby-1.9.2-p0 ?>  end
>  NameError: uninitialized constant X::M

Writing

    include ::M

seems to work.  Why not use that instead?

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:37799] [Ruby 1.9 - Feature #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
                   ` (6 preceding siblings ...)
  2011-07-04 17:34 ` [ruby-core:37786] [Ruby 1.9 - Feature " Lazaridis Ilias
@ 2011-07-05 14:31 ` Thomas Sawyer
  2011-07-05 15:09 ` [ruby-core:37800] " Thomas Sawyer
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Thomas Sawyer @ 2011-07-05 14:31 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Thomas Sawyer.


@nikolai Yes, that will work in some cases. For a case where it will not, see the eval example I gave above.
----------------------------------------
Feature #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:37800] [Ruby 1.9 - Feature #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
                   ` (7 preceding siblings ...)
  2011-07-05 14:31 ` [ruby-core:37799] " Thomas Sawyer
@ 2011-07-05 15:09 ` Thomas Sawyer
  2011-07-05 15:34 ` [ruby-core:37801] " Jeremy Evans
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Thomas Sawyer @ 2011-07-05 15:09 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Thomas Sawyer.


@jeremy You make a good case. My general sense of it is YAGNI, but I can't completely rule it out. Who knows, maybe someone will have need of a very clever way to resolve constants for their own classes. But, I think we are perilously close here to that "well-chosen-line" that separates the dependable static language from the convenient dynamic one. If a work around can be found for my eval case, as given above, then I am perfectly happy to concede this issue.

I do want to make one point clear however, as I think your explanation could be interpreted as making a false equivalency. To point, constant look-up and method look-up should not be confused for analogous features. They are in fact quite different. Method look-up operates through the class-hierarchy, while constants are a strange hybrid, which primarily operate through the namespace, but also include the class hierarchy, basically as a matter of convenience. So I still maintain that constant look-up should ultimately terminate at the toplevel (even if BasicObject ignores this). Just as I also am certain that toplevel method definitions really should not be polluting the Object class.

----------------------------------------
Feature #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:37801] [Ruby 1.9 - Feature #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
                   ` (8 preceding siblings ...)
  2011-07-05 15:09 ` [ruby-core:37800] " Thomas Sawyer
@ 2011-07-05 15:34 ` Jeremy Evans
  2011-07-05 19:45 ` [ruby-core:37806] " Thomas Sawyer
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Jeremy Evans @ 2011-07-05 15:34 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Jeremy Evans.


Thomas, your example works on 1.9.2p180:

$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-openbsd4.9]
$ cat > q.rb
  class R
  end

  class Q < BasicObject
    def r; R.new; end
  end
$ irb
irb(main):001:0> module M; eval(File.read('q.rb')); end
=> nil
irb(main):002:0> M::Q.new.r
=> #<M::R:0x00000208a42590>

It doesn't work if you change R.new to ::R.new, but that's to be expected (it would be the same if Q descended from Object).

It even works if R and Q are defined in separate files:

$ cat > r.rb
  class R
  end
$ cat > q.rb
  class Q < BasicObject
    def r; R.new; end
  end
$ irb
irb(main):001:0> module M; eval(File.read('r.rb')); end
=> nil
irb(main):002:0> module M; eval(File.read('q.rb')); end
=> nil
irb(main):003:0> M::Q.new.r
=> #<M::R:0x0000020b76cbb0>

The behavior is still the same on "ruby 1.9.3dev (2011-02-28 trunk 30975) [x86_64-openbsd4.9]", so if it no longer works, it must have changed in the last few months.

I agree that constant lookup and method lookup are not the same thing, and should not necessarily be treated the same way.  However, I think the purpose of BasicObject is, to the extent possible, remove the default behavior that most objects have in order to allow the programmer to define their own behavior.  Therefore, I think allowing the programmer control over constant lookup in BasicObject subclasses makes sense.
----------------------------------------
Feature #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:37806] [Ruby 1.9 - Feature #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
                   ` (9 preceding siblings ...)
  2011-07-05 15:34 ` [ruby-core:37801] " Jeremy Evans
@ 2011-07-05 19:45 ` Thomas Sawyer
  2011-07-10 15:09 ` [ruby-core:37967] " Thomas Sawyer
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Thomas Sawyer @ 2011-07-05 19:45 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Thomas Sawyer.


You're right, it does work. I recollect testing it, but I must have misconstrued the actual error I was getting at the time. Too long ago now to recall the details.

Okay. I will write up docs on using #const_missing with BasicObject and submit it.

Thanks for reviewing this in detail.
----------------------------------------
Feature #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:37967] [Ruby 1.9 - Feature #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
                   ` (10 preceding siblings ...)
  2011-07-05 19:45 ` [ruby-core:37806] " Thomas Sawyer
@ 2011-07-10 15:09 ` Thomas Sawyer
  2011-08-09 15:18 ` [ruby-core:38878] " Thomas Sawyer
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Thomas Sawyer @ 2011-07-10 15:09 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Thomas Sawyer.


I submitted documentation addition.

  https://github.com/ruby/ruby/pull/31


----------------------------------------
Feature #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:38878] [Ruby 1.9 - Feature #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
                   ` (11 preceding siblings ...)
  2011-07-10 15:09 ` [ruby-core:37967] " Thomas Sawyer
@ 2011-08-09 15:18 ` Thomas Sawyer
  2011-08-09 21:10 ` [ruby-core:38882] " Eric Hodel
  2011-08-09 21:35 ` [ruby-core:38883] " Thomas Sawyer
  14 siblings, 0 replies; 16+ messages in thread
From: Thomas Sawyer @ 2011-08-09 15:18 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Thomas Sawyer.


Can we merge?
----------------------------------------
Feature #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:38882] [Ruby 1.9 - Feature #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
                   ` (12 preceding siblings ...)
  2011-08-09 15:18 ` [ruby-core:38878] " Thomas Sawyer
@ 2011-08-09 21:10 ` Eric Hodel
  2011-08-09 21:35 ` [ruby-core:38883] " Thomas Sawyer
  14 siblings, 0 replies; 16+ messages in thread
From: Eric Hodel @ 2011-08-09 21:10 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Eric Hodel.


I committed documentation based on your pull request as r32700 in the closed Bug #5067.  There is no need to merge.
----------------------------------------
Feature #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [ruby-core:38883] [Ruby 1.9 - Feature #3768] Constant Lookup doesn't work in a subclass of BasicObject
       [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
                   ` (13 preceding siblings ...)
  2011-08-09 21:10 ` [ruby-core:38882] " Eric Hodel
@ 2011-08-09 21:35 ` Thomas Sawyer
  14 siblings, 0 replies; 16+ messages in thread
From: Thomas Sawyer @ 2011-08-09 21:35 UTC (permalink / raw
  To: ruby-core


Issue #3768 has been updated by Thomas Sawyer.


Okay. That's great. 

Reading it over I have a couple of impressions that could help improve upon it:

1) The use of "standard library" is confusing, in contrast to core vs. standard libs.

2) There is no mention of "constant look-up" which would be more technically poignant.

3) The word "like" is a bit over-used.

So when you get a chance maybe you can work these consideration in. 

Thanks. I will close this ticket.

----------------------------------------
Feature #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-08-09 21:21 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-3768.20100831040809@ruby-lang.org>
2011-07-03 19:05 ` [ruby-core:37756] [Ruby 1.9 - Bug #3768] Constant Lookup doesn't work in a subclass of BasicObject Thomas Sawyer
2011-07-05 11:23   ` [ruby-core:37794] " Nikolai Weibull
2011-07-03 22:37 ` [ruby-core:37760] " Yukihiro Matsumoto
2011-07-04  0:07 ` [ruby-core:37762] " Thomas Sawyer
2011-07-04  0:38 ` [ruby-core:37763] " Jeremy Evans
2011-07-04  1:48 ` [ruby-core:37764] " Thomas Sawyer
2011-07-04  2:16 ` [ruby-core:37765] " Jeremy Evans
2011-07-04 17:34 ` [ruby-core:37786] [Ruby 1.9 - Feature " Lazaridis Ilias
2011-07-05 14:31 ` [ruby-core:37799] " Thomas Sawyer
2011-07-05 15:09 ` [ruby-core:37800] " Thomas Sawyer
2011-07-05 15:34 ` [ruby-core:37801] " Jeremy Evans
2011-07-05 19:45 ` [ruby-core:37806] " Thomas Sawyer
2011-07-10 15:09 ` [ruby-core:37967] " Thomas Sawyer
2011-08-09 15:18 ` [ruby-core:38878] " Thomas Sawyer
2011-08-09 21:10 ` [ruby-core:38882] " Eric Hodel
2011-08-09 21:35 ` [ruby-core:38883] " Thomas Sawyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).