On 11/15 12:58, Jos? Francisco Calvo Moreno wrote:
> Hi all!
> 
> In order to increase Ruby code readability I have met many times with
> the need to add the following methods to Fixnum:
> 
>   #positive?  (return true if number > 0, return false if number < 0)
>   #negative? (return true if number < 0, return false if number > 0)
 
Is

  number.positive?

really more readable than

  number > 0

I personally think the > operator is more readable, so I would be
against including this in core.  Plus, your description of the methods
does not describe the behavior of the case where number == 0 (though I
can guess the desired behavior).  By your reasoning, we would also have
to add nonpositive? and nonnegative? for <= 0 and >= 0.

If you were going to add it, why would you want to add this just to
Fixnum instead of a superclass like Integer or Numeric?

Jeremy