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 234A919C000E for ; Sat, 26 Sep 2015 20:22:02 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id E0130B5D864 for ; Sat, 26 Sep 2015 20:45:47 +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 CC0BB952439 for ; Sat, 26 Sep 2015 20:45:47 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id DC2C51207AE; Sat, 26 Sep 2015 20:45:45 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id AC7001207A6 for ; Sat, 26 Sep 2015 20:45:41 +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=qbIU8RTpMb/7rwM85Y63dYhHCxI=; b=a3ZRyxUOoQcjq1gt7W iK4tlIvXoF8kR0FRKYj9hVi3JO0WEse2xbJVxJpMmoAhMBWE24pYoxNvZn2uQTfa iSbeiHDFXuubWJM9IN/aR0aZ6bJi9k8FHF769iqA3CV5xTjVJ78WJREUogvCxmlj np/uI1/JDvG78ZiD2ZExr8GOE= Received: by filter0450p1mdw1.sendgrid.net with SMTP id filter0450p1mdw1.20286.5606856041 2015-09-26 11:45:36.764171556 +0000 UTC Received: from herokuapp.com (ec2-54-205-78-103.compute-1.amazonaws.com [54.205.78.103]) by ismtpd0005p1iad1.sendgrid.net (SG) with ESMTP id 3lA0PHRxQOqK0xg0V1ferA Sat, 26 Sep 2015 11:45:36.838 +0000 (UTC) Date: Sat, 26 Sep 2015 11:45:36 +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: 45525 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS6UqBysLWg+JffqK5j8UzZduLu9tPJbgRnSmN NffmzQXoT3YWw/3LBJVnmRW4OqY/Xwt6td+6T8dwB2uQultxu03Td0QTSdOQ692yrM2/rlTp1NCeB8 3T2J14QKnT8MRmT5Xf0jUyDGJgtaiKFaWxFK X-SendGrid-Contentd-ID: {"test_id":"1443267938"} X-ML-Name: ruby-core X-Mail-Count: 70919 Subject: [ruby-core:70919] [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. Where do we go from here? Is my patch acceptable? If no, what should I change? If yes, what's the process for getting it merged? ---------------------------------------- Feature #10594: Comparable#clamp https://bugs.ruby-lang.org/issues/10594#change-54282 * 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/