[#3006] mismatched quotation — "stevan apter" <apter@...>

ruby documentation uses a punctuation convention i've never seen

13 messages 2000/05/27

[ruby-talk:02876] Re: Just one more wafer thin mint....

From: David Suarez de Lis <excalibor@...>
Date: 2000-05-18 08:04:26 UTC
List: ruby-talk #2876
(This message has been sent to comp.lang.ruby and is posted here just in case not everybody reaches it)

In article <87puqk1tin.fsf_-_@ev.netlab.co.jp>,
  Yukihiro Matsumoto <matz@netlab.co.jp> wrote:

<snip>

> |The reason people implement odd but not even is that odd is
> |unambiguous, but people seem to disagree about whether zero is even.
> 
> Really?  I learned 0 is a even when I was in elementary school.
> I thought it was a common sense.
> 
> 							matz.

"Andrew Hunt" <andy@Toolshed.Com> replied in Ruby-Talk:

<snip>

> But how would you expect zero to work? I believe that zero 
> is considered even (something like: "an integer n is called *even* if 
> there exists an integer m such that n = 2m", so 0 = (2)(0) is even).

Actually, from my Calculus, I recall that 0 is not even considered a natural number...

N = {1, 2, 3, 4, ...}              # these are the natural numbers
Z = {0, 1, -1, 2, -2, 3, -3, ...}  # and these are the (real :) integers

(actually Z = N U -N U {0})

and the definition of even number is 2N = { n E N / n%2 = 0 } which only applies to natural positive numbers...

It's a matter of wholedness (no pun intended :), as when 0 enters into a definition, lots of definitions and tautologoes and theorems break...

Regarding adding the method, for the sake of small interfaces, I'd say (n%2 == 1) is short enough and obvious enough to a programmer to be just enough (aliteration and repetition by accident :)

just my E0.02 worth,
d@
--
<excalibor at demasiado.com>
<excalibor@my-deja.com>
-------------------------------------------------------------
Mensaje enviado gracias al correo gratuito de Demasiado Corp.
[ http://correo.demasiado.com ]
-------------------------------------------------------------

			   

In This Thread

Prev Next