This and other RFCs are available on the web at
  http://dev.perl.org/rfc/

=head1 TITLE

Method calls SHOULD suffer from ambiguity by default

=head1 VERSION

  Maintainer: Nathan Wiger <[EMAIL PROTECTED]>
  Date: 24 Sep 2000
  Last Modified: 28 Sep 2000
  Mailing List: [EMAIL PROTECTED]
  Number: 277
  Version: 2
  Status: Developing

=head1 CHANGES

The first version was too cute, trying to prove a point but failing
miserably. So here it is, in plain English.

=head1 ABSTRACT

RFC 244 proposes special-casing -> to quote the left operand, and
eliminating the bareword indirect object syntax entirely.

These are both Bad Ideas, and will likely cause a large number of
longtime Perl hackers to run away screaming.

Many people, myself included, view the ability to type:

   $q = new CGI;
   $val = shift->{fullname};

And have Perl DWIM is what makes Perl Perl, and fun. Forcing me to
write:

   $q = new {'CGI'};
   $val = shift()->{fullname};

Because this ambiguity upsets a few people is just plain silly. And
B<very> un-fun.

Tightening this syntax by default makes no sense. Rather, this is
something that can easily be added to C<use strict>. See B<RFC 278> for
details on C<use strict 'words'> and C<use strict 'objects'>.

=head1 DESCRIPTION

In Perl 5, there are already plenty of ways in which people can
B<voluntarily> disambiguate the above:

   $q = new 'CGI';               # main::new('CGI');
   $q = CGI::->new;              # or 'CGI'->new;

   $val = shift::->{fullname};   # or 'shift'->{fullname}
   $val = shift()->{fullname};   # main::shift()->{fullname}

And if people want this to be enforced, then they can easily C<use
strict 'words'> as specified in RFC 278.

Perl 6 should be a value add to Perl 5. It should not take away
established, widely-used syntax just because of a little ambiguity. This
is hardly the only syntactic ambiguity in Perl.

=head1 IMPLEMENTATION

Perl 6 should tokenize the above just like Perl 5.

=head1 MIGRATION

None. Why would we want there to be?

=head1 REFERENCES

RFC 28:  Perl should stay Perl.

RFC 278: Additions to 'use strict' to fix syntactic ambiguities

RFC 244: Method calls should not suffer from the action on a distance

Reply via email to