Feature #10974
closed[PATCH] Remove methods which has suffix `!`(sin!, cos!…) from CMath
Description
Hi, now I’d like to remove methods with !
( sin!
, cos!
…) from CMath
, for the following reasons.
-
wanna keep CMath minimal.
CMath#sin
should be superset ofCMath#sin!
orMath#sin
is enough. -
rdoc for CMath seems broken,
CMath#sin!
isn't alias forCMath#sin
thanks, gogo.
Files
Updated by matz (Yukihiro Matsumoto) over 9 years ago
I am OK with this change. Does anyone else have opinon on this?
E.g. compatibility issue?
Matz.
Updated by normalperson (Eric Wong) over 9 years ago
matz@ruby-lang.org wrote:
I am OK with this change. Does anyone else have opinon on this?
E.g. compatibility issue?
I don't use CMath, but I suggest a deprecation period since it appears
this is a public API. We should never break public API without adequate
warning.
Maybe:
- deprecate at 2.3.0
- remove when 2.3 branch is EOL for backports/releases
Updated by gogotanaka (Kazuki Tanaka) over 9 years ago
Eric Wong wrote:
I don't use CMath, but I suggest a deprecation period since it appears
this is a public API. We should never break public API without adequate
warning.Maybe:
- deprecate at 2.3.0
- remove when 2.3 branch is EOL for backports/releases
Thanks for comment! I suppose these methods(Math.cos!, sin!..) got public by accident, but your point dose really make sense.
Here is a patch to deprecate these methods.
I'll commit it in a while.
Updated by gogotanaka (Kazuki Tanaka) almost 9 years ago
- Subject changed from [PATCH] Remove methods with `!`(sin!, cos!…) from CMath to [PATCH] Remove methods which has suffix `!`(sin!, cos!…) from CMath
Updated by Hanmac (Hans Mackowiak) almost 9 years ago
i know this ticket got closed by the change of gogo,
but i want to ask (maybe in a different ticket later)
if its would be ok to have a deprecate_methods function like the deprecate_constant method in core?
#11588 might be similar to what i want
Updated by ngoto (Naohisa Goto) almost 9 years ago
The infinite loop observed during RubySpec test in r52469
(http://rubyci.s3.amazonaws.com/ubuntu1510/ruby-trunk/log/20151106T153002Z.fail.html.gz )
is caused by the following code in mathn.rb.
unless defined?(Math.exp!)
Object.instance_eval{remove_const :Math}
Math = CMath # :nodoc:
end
Updated by ngoto (Naohisa Goto) almost 9 years ago
- Status changed from Open to Closed
Applied in changeset r52715.
- lib/cmath.rb: methods which has suffix '!' are now deprecated.
Re-apply r52469 made by Kazuki Tanaka, with fixing bug about
mathn.rb compatibility. [ruby-core:68528] [Feature #10974]