< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #10594 has been updated by Yukihiro Matsumoto.
I accept the idea of `#clamp` as `Comparable#clamp(min, max)`.
It would not accept ranges (for now).
Matz.
----------------------------------------
Feature #10594: Comparable#clamp
https://bugs.ruby-lang.org/issues/10594#change-59996
* Author: Chris Johnson
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
This is basically a re-opening of the feature request of issue#4573 (https://bugs.ruby-lang.org/issues/4574), which was closed due a naming debate.
It seems the standard naming for restricting a number to a specified range is indeed 'clamp'. (1)(2)(3)
As such, can we use Yusuke Endoh's original patch with the naming adjustments? If so, I can provide accordingly.
Cheers.
(1) http://www.rubydoc.info/github/epitron/epitools/Numeric:clamp
(2) http://stackoverflow.com/questions/12020787/is-there-a-limit-clamp-function-in-ruby
(3) https://developer.gnome.org/glib/stable/glib-Standard-Macros.html#CLAMP:CAPS
---Files--------------------------------
num_clamp.c (427 Bytes)
comparable-clamp.diff (2.52 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>