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

Re: Indirect object syntax

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
May 25, 2016 16:48
Subject:
Re: Indirect object syntax
Message ID:
20160525164842.GA29330@debian
* Abigail <abigail@abigail.be> [2016-05-25T12:47:14]
> 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 think this happens pretty often, in cases like:

  #!perl
  use strict;

  ...

  my $x = try {
    foo();
    bar();
  };

You forgot to import try(&).  Perl does:  { foo(); bar(); }->try;

It's only detected at runtime, after foo() and bar() have run.  If this could
be detected at compile time as an indirect method call, you'd be saved
heartache.

I think this would be a big win.

-- 
rjbs

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