From: "José Francisco Calvo Moreno" Date: 2011-11-15T18:51:21+09:00 Subject: [ruby-core:41058] Re: Proposal to add new methods: positive? negative? natural? --000e0cd3ea08df7f7f04b1c2ed1a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I don't have a deep understanding of ruby core base types but I want to create the patch by myself. Where is the best place to add this functionality (positive?, negative? method)? Fixnum? Integer? Numeric?. 2011/11/14 Anurag Priyam > 2011/11/14 Jos=E9 Francisco Calvo Moreno : > [...] > > The only problem that I see is that > > not 0.positive? =3D> true > > could be confusing and you may think that 0 is negative (when it is not= ). > > I don't think it is confusing. You are explicitly asking Ruby to > negate the value. `not 0.even?` returns false, but 0 is even. > > I like the idea. > > -- > Anurag Priyam > > --000e0cd3ea08df7f7f04b1c2ed1a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I don't have a deep understanding of ruby core base types but I want to= create the patch by myself. Where is the best place to add this functional= ity (positive?, negative? method)? Fixnum? Integer? Numeric?.

2011/11/14 Anurag Priyam <<= a href=3D"mailto:anurag08priyam@gmail.com">anurag08priyam@gmail.com>=
2011/11/14 Jos=E9 Francisco Calvo Moreno <josefranciscocalvo@gmail.com>:
[...]
> The only problem that I see is that
> =A0not 0.positive? =3D> true
> could be confusing and you may think that 0 is negative (when it is no= t).

I don't think it is confusing. You are explicitly asking Ruby to<= br> negate the value. `not 0.even?` returns false, but 0 is even.

I like the idea.

--
Anurag Priyam


--000e0cd3ea08df7f7f04b1c2ed1a--