develooper Front page | perl.perl5.porters | Postings from May 2016

Re: Indirect object syntax

Thread Previous | Thread Next
From:
Eric Brine
Date:
May 31, 2016 16:34
Subject:
Re: Indirect object syntax
Message ID:
CALJW-qGDFkk3WCh7NEcN7Uz1mHbcOvZuHPrOWF7tc3CyrcqTSQ@mail.gmail.com
On Wed, May 25, 2016 at 12:47 PM, Abigail <abigail@abigail.be> wrote:

> I'd argue [indirect.pm] doesn't belong in core. At all.
>

> The reason is it's limited usefulness. People who want to use indirect
> object syntax certainly won't start their programs with 'no indirect'.
> It's only useful for people who don't want indirect object syntax in
> their programs, but somehow use it anyway.
>
> I don't think there's much code which will benefit from it, and the
> amount of code will dwindle over time.
>

It if worked, it would be useful for people who don't want indirect object
syntax in their programs, but **accidentally use something that's
interpreted as indirect object notation**.

One of the problems with indirect notation is that it causes really weird
error messages for certain syntax errors and for certain missing
declarations.

C<< no indirect; >> is suppose to remove support for indirect object
notation, which would avoiding these odd error messages. Right now, it's
not able to achieve that. To achieve that, it would it needs support in the
parser that doesn't currently exist.

Thus, indirect.pm *needs* to be moved to the core to be useful.

On Wed, May 25, 2016 at 06:32:06PM +0200, Vincent Pit (VPIT) wrote:

> Even if that's not the topic of this thread, I will reiterate that I
> would strongly object to incorporating the current implementation of
> indirect in core. That's not the way you should do it when you can just

hack into the parser.
>

Indeed. It shouldn't be incorporated as is. There'd be no point to doing
that. The interface should be incorporated, but it should prevent indirect
object notation from being recognized rather than checking if it was used
after the fact.

- Eric

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About