> I think the idea that => is "just another comma" is pretty widespread
> now.

Just for the record I've always thought this was stupid. That's just my
opinion, true, but there's a fine line between TMTOWTDI and pure
confusion.

IMO, if you're going to have a different operator, make it do something
different. Especially something as stand-out as =>, which many people
confuse with -> already.

What I'd like to see this RFC say instead of/in addition to the PAIR
idea is that => can be used to create hashrefs without having to have
{}. So these two would be equivalent:

   @foo = ( { one => two }, three, four );
   @foo = ( one => two, three, four );

I know, I know, the => doesn't really have anything todo with how hashes
are built. However, its widespread use in this syntax sure makes people
think it does.

This wouldn't change the key/value idea, you could still get to the data
with it:

   $foo = $key => $value;
   $foo->{$key};  # $value
   key $foo;      # $key
   value $foo;    # $value

   # these are the same
   value $foo = $value2; 
   $foo->{$key} = $value2;

   # what key does is rename the existing key
   key $foo = $key2;   # like delete $foo->{$key}, then
                       # $foo->{$key2} = $value

Or something like that. The RFC touches on this, but I think it should
just go all the way and make => into its own operator.

-Nate

Reply via email to