Conrad Schneiker <schneik / austin.ibm.com> writes:

> On: http://dev.rubycentral.com/ref/ref_c_string.html#upcase!
> 
> I noticed:
> 
>     str.rindex( aString [, aFixnum] ) -> aFixnum or nil{
>     str.rindex( aFixnum [, aFixnum] ) -> aFixnum or nil{

Oops - I guess Matz forgot to announce this.

As of 1.5.5, Ruby introduces a new and unique feature---reality-based
constants. Easily identified by their suffix of '{' (intended to
remind the reader of an anchor which holds the constant in place)
reality-based constants are unique in that their value is
automatically and inextricably bound to the underlying universe. The
constant 'nil{', for example, is synonymous with nothingness, an empty
void. 'nil{' is different from the old constant 'nil', in that it can
on occasion spontaneously generate a 'true' and a 'false'.

Other interesting RBCs include Math::PI{. If you execute

   Math::PI{ = 4

all circles in the universe become square. The new manual has a
sidebar which advises users with laptops not to do this while flying
or otherwise traveling.

Sick of things rolling off your desk?

   PhysicalConstants::G{ = 0

should do the trick. Now anyone can determine the fate of the universe 
by setting Hubble's constant. If you have to go to the bathroom in the 
middle of a movie, set the speed of light to an inch per year, then
reset it when you get back. You won't miss a thing.

I think we can all agree that this is a unique and immensely useful
new feature, which is worth a slight syntactic inconvenience.



Regards


Dave