Re: cleaning perl code - Mailing list pgsql-hackers

From Mark Dilger
Subject Re: cleaning perl code
Date
Msg-id 97813D8D-F185-4998-8CF8-5678746E7DEE@enterprisedb.com
Whole thread Raw
In response to Re: cleaning perl code  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
Responses Re: cleaning perl code
List pgsql-hackers

> On Apr 11, 2020, at 9:13 AM, Andrew Dunstan <andrew.dunstan@2ndquadrant.com> wrote:

Hi Andrew.  I appreciate your interest and efforts here.  I hope you don't mind a few questions/observations about this
effort:

>
>  The
> last one fixes the mixture of high and low precedence boolean operators,

I did not spot examples of this in your diffs, but I assume you mean to prohibit conditionals like:

    if ($a || $b and $c || $d)

As I understand it, perl introduced low precedence operators precisely to allow this.  Why disallow it?

> and the use of commas to separate statements

I don't understand the prejudice against commas used this way.  What is wrong with:

    $i++, $j++ if defined $k;

rather than:

    if (defined $k)
    {
        $i++;
        $j++;
    }

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company






pgsql-hackers by date:

Previous
From: Jose Luis Tallon
Date:
Subject: Re: where should I stick that backup?
Next
From: Paul A Jungwirth
Date:
Subject: Re: range_agg