Forum: Ruby-core [Rejected] Immediates Should Not Respond to :dup

F24ff61beb80aa5f13371aa22a35619c?d=identicon&s=25 Yusuke Endoh (Guest)
on 2012-02-14 14:17
(Received via mailing list)
Issue #1844 has been updated by Yusuke Endoh.

Status changed from Assigned to Rejected

I'm rejecting this feature ticket because no progress has been
made for a long time.  See [ruby-core:42391].



My personal opinion.

I might miss somthing, but I cannot understand the motivation
well.  When we duplicate an object, we then usually modify the
object, don't we?  To modify them, we must eventually check the
type.  I wonder why this feature is needed.

It makes no sense (to me) to compare a method that raises
NotImplementedError with Immediate.dup.  They are different.
In an extreme case, Kernel#raise always raise an exception.
Do you think respond_to?(:raise) should return false?

--
Yusuke Endoh <mame@tsg.ne.jp>
----------------------------------------
Feature #1844: Immediates Should Not Respond to :dup
https://bugs.ruby-lang.org/issues/1844

Author: Run Paint Run Run
Status: Rejected
Priority: Low
Assignee: Yukihiro Matsumoto
Category:
Target version: 2.0.0
ruby -v: ruby 1.9.2dev (2009-07-08 trunk 23995) [i686-linux]


=begin
 Immediate can't be dup'd but they :respond_to?(:dup). This leads to
ugly logic for determining whether a value can be dup'd. I suggest that
immediates return false for :respond_to?(:dup). This is consistent with
methods that would raise a NotImplementedError returning false for
#respond_to?.
=end
This topic is locked and can not be replied to.