From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 8AA1919A0311 for ; Thu, 3 Sep 2015 02:51:59 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (smtp.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id EF6EDB5D847 for ; Thu, 3 Sep 2015 03:12:51 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 14E5797A820 for ; Thu, 3 Sep 2015 03:12:52 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id E05BD95243E for ; Thu, 3 Sep 2015 03:12:51 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 9DB5212068C; Thu, 3 Sep 2015 03:12:49 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id CA04E120687 for ; Thu, 3 Sep 2015 03:12:45 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=OSGioeIfDOEQbFcFYhfPms3WCFo=; b=ScasMiY+311ywwE2iA yGn0Ljvj8leSG4x2v63ekTcn5kh4rwPsDmoEa3GY1K2PwACg0GWi6ClKhnUFVDGR MxibTQaZn+o/4fKH+qjbs3ZX1O4+o8V7MYHucG6J/XkKy8zGihT16j7r4GDWor6K 7VRkMGG9bsW0wyvO6vzzS7w1U= Received: by filter0475p1mdw1.sendgrid.net with SMTP id filter0475p1mdw1.9439.55E73C1224 2015-09-02 18:12:34.633982121 +0000 UTC Received: from herokuapp.com (ec2-54-157-13-63.compute-1.amazonaws.com [54.157.13.63]) by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id rHbecekWTAGoOTuqs7jQkg Wed, 02 Sep 2015 18:12:34.520 +0000 (UTC) Date: Wed, 02 Sep 2015 18:12:34 +0000 From: nerdinand@nerdinand.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 45272 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 10594 X-Redmine-Issue-Author: findchris X-Redmine-Sender: nerdinand X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS53JRtr4MmqJ3XnVeOfDXIlDt+irTYD9H0kmv JdTliE+KcSgSDB74ArxT13tu2FRKmadBlgz6jovzEB+4Xwm4MH4clyhZvmP2rbonir773FQUnr8yIZ nXhhUk8kDd2iAAs92fcYgYckRGz60XVxpMOJ X-ML-Name: ruby-core X-Mail-Count: 70655 Subject: [ruby-core:70655] [Ruby trunk - Feature #10594] Comparable#clamp X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #10594 has been updated by Ferdinand Niedermann. File comparable-clamp.diff added Subject changed from Numeric#clamp to Comparable#clamp ---------------------------------------- Feature #10594: Comparable#clamp https://bugs.ruby-lang.org/issues/10594#change-54053 * 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/