Tue, 26 Nov 2002 06:30:36 +0900: Daniel Carrera (Daniel Carrera
<dcarrera / math.umd.edu>):

> > 9. Ruby has no pre/post increment/decrement operator. For instance,
> > x++ or x-- will fail to parse.
> 
> Why is that?  x++ and x-- are very convenient.  I sort of understand
> why++x and --x don't exist.  But why can't numbers have a "++" and
> "--" method?

I don't see it as that big of a deal. "very convenient"? How
about "marginally convenient"? Really, how much more convenient is this:

x++

over this?

x += 1

By my count, it's two spaces, a shift key, and an extra character. And
you can drop the spaces if you'd like. But the second form certainly
seems more clear to me, and I even use +=1 over ++ in /all/ languages I
code in.

If Ruby supported neither ++ /nor/ +=, then it'd get a little annoying,
as you'd have to x = x + 1, but I really just don't see what makes it
"very convenient". 


-- 
< There is a light that shines on the frontier >
<   And maybe someday, We're gonna be there.   >
<    Rando Christensen / rando / babblica.net    >