[#44904] [ruby-trunk - Bug #5688][Open] Solaris10 で spawn を繰り返すとメモリリークする — okkez _ <redmine@...>

14 messages 2011/11/29

[ruby-dev:44775] [ruby-trunk - Feature #5549][Open] Comparable#min, Comparable#max

From: Tsuyoshi Sawada <sawadatsuyoshi@...>
Date: 2011-11-02 17:45:19 UTC
List: ruby-dev #44775
Issue #5549 has been reported by Tsuyoshi Sawada.

----------------------------------------
Feature #5549: Comparable#min, Comparable#max
http://redmine.ruby-lang.org/issues/5549

Author: Tsuyoshi Sawada
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 


I request the following methods

    Comparable#min(other)
    Comparable#max(other)

which will work the same as

    [self, other].min
    [self, other].max

and can be defined as

    module Comparable
	def min other; [self, other].min end
	def max other; [self, other].max end
    end

Example use case: If you need to ensure that some calculated value becomes at least zero within a method chain.


-- 
http://redmine.ruby-lang.org

In This Thread

Prev Next