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 (smtp.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 5688A1A80067 for ; Fri, 22 Jul 2016 19:21:58 +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 2B7B5B5D87C for ; Fri, 22 Jul 2016 19:55:57 +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 BDB0018D1D4E for ; Fri, 22 Jul 2016 19:55:57 +0900 (JST) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id CD1DE120434; Fri, 22 Jul 2016 19:55:57 +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 B67EC1203A8 for ; Fri, 22 Jul 2016 19:55:54 +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=X5VDaJlvZQlnz8JwNFVCgT9Is9U=; b=Kem2alR9WjqF3PdQUe lu9gancLdIwhiW4jzqo3TEg9gvcJY2E3M6WqFw/uzBpMzPyKdVopvMhoWgHsHgV0 nAVsXCC1G98IZzHH9dMgdxzM8LXWaDQvj7GvQs9OZqQV/omk65lu62n1PUlNEkv8 NVzMaLj3asM02tZv+HLZjTsII= Received: by filter0123p1las1.sendgrid.net with SMTP id filter0123p1las1.12859.5791FBB53A 2016-07-22 10:55:49.553085092 +0000 UTC Received: from herokuapp.com (ec2-54-196-123-20.compute-1.amazonaws.com [54.196.123.20]) by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id se9BPneLSmKg0ECzuk1INA Fri, 22 Jul 2016 10:55:49.454 +0000 (UTC) Date: Fri, 22 Jul 2016 10:55:49 +0000 From: shyouhei@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 51293 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 10594 X-Redmine-Issue-Author: findchris X-Redmine-Sender: shyouhei 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS6HslGxUyuWxj35TBlklu6gt8rKZETlBtDxcm lJEUr3vudknCZQG1uv2tOMBHJfU7lW4/hLpRUzVRVF6fLxR+q3JFOsiAHurPOPTxNSU1RbPYzh3I63 VBvP2a6Yp5QEElN4sdafs5bJS/VLu8uzpDr/Rh0qupr7P5p9ctQHSHeKUQ== X-ML-Name: ruby-core X-Mail-Count: 76528 Subject: [ruby-core:76528] [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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #10594 has been updated by Shyouhei Urabe. Ferdinand Niedermann wrote: > Thanks, but I don't think I have access to editing this page. Or at least I can't find the button for it... Added a link to this issue. ---------------------------------------- Feature #10594: Comparable#clamp https://bugs.ruby-lang.org/issues/10594#change-59771 * 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/