> =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<<foo()->bar($baz)>> > depending on how the symbol C<foo> 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
- RFC 244 (v1) Method calls should not suffer from the a... Perl6 RFC Librarian
- Re: RFC 244 (v1) Method calls should not suffer f... Michael G Schwern
- Re: RFC 244 (v1) Method calls should not suffer f... Nathan Wiger
- Re: RFC 244 (v1) Method calls should not suff... John Porter
- Re: RFC 244 (v1) Method calls should not suffer f... John Porter
- Re: RFC 244 (v1) Method calls should not suff... Tom Christiansen
- Re: RFC 244 (v1) Method calls should not suffer f... Nathan Wiger
- Re: RFC 244 (v1) Method calls should not suff... Ilya Zakharevich
- Accessing perl's command line switches Nathan Wiger
- Accessing perl's command line switches Chaim Frenkel
- Re: Why -> cannot autoquote the LHS (was R... Glenn Linderman
- Re: RFC 244 (v1) Method calls should not suffer f... Ilya Zakharevich
- Re: RFC 244 (v1) Method calls should not suff... Nathan Wiger
- Re: RFC 244 (v1) Method calls should not ... Ilya Zakharevich
- Re: RFC 244 (v1) Method calls should ... Nathan Wiger
- Re: RFC 244 (v1) Method calls sh... Ilya Zakharevich
- Re: RFC 244 (v1) Method calls should not ... Tom Christiansen