Re: Why -> cannot autoquote the LHS (was Re: RFC 244 (v1) Method calls should not suffer...)

2000-09-30 Thread Glenn Linderman

Nathan Wiger wrote:

> (And if the RFC is proposing autoquoting only barewords, then I think
> that's _really_ inconsistent and should not be done.)

Isn't autoquoting only barewords precisely the type of autoquoting that => does?
So there is a precedent.  I've been assuming all along that that is exactly what
the RFC is proposing.

--
Glenn
=
Even if you're on the right track,
you'll get run over if you just sit there.
   -- Will Rogers



_NetZero Free Internet Access and Email__
   http://www.netzero.net/download/index.html



Why -> cannot autoquote the LHS (was Re: RFC 244 (v1) Method calls should not suffer...)

2000-09-29 Thread Nathan Wiger

> =head1 TITLE
> 
> Method calls should not suffer from the action on a distance

> Currently,
> 
>   foo->bar($baz)
> 
> can be parsed either as C<<'foo'->bar($baz)>>, or as C>
> depending on how the symbol C was used on other places.  The proposal
> is to always choose the first meaning: make C<< -> >> autoquote the bareword
> on the left.

Before I forget to mention this again, here is why -> *cannot* autoquote
the LHS:

   package Foo;

   use overload q("") => STRING;

   sub new { bless {@_}, shift; }

   sub STRING {
   return "Hello World!";
   }

   sub getdata {
   # do stuff
   }

   package main;

   my $foo = new Foo;
   @data = $foo->getdata;  # !!!   


Unless we want that last line to fail - essentially rendering use
overload and polymorphic objects useless - then the -> operator must not
autoquote the LHS.

(And if the RFC is proposing autoquoting only barewords, then I think
that's _really_ inconsistent and should not be done.)

-Nate