Re: [PATCH v5 08/13] send-email: use function syntax instead of barewords
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- May 29, 2021, 08:17 UTC
- Message-ID
- <87fsy62bs1.fsf@evledraar.gmail.com>
- In-Reply-To
- <60b116015b98a_4b03220857@natae.notmuch>
On Fri, May 28 2021, Felipe Contreras wrote:
Show 14 quoted lines
> Ævar Arnfjörð Bjarmason wrote:
>> Change calls like "__ 'foo'" to "__('foo')" so the Perl compiler
>> doesn't have to guess that "__" is a function. This makes the code
>> more readable.
>
> Agreed. Ruby has something similar:
>
> foo arg1, arg2
> foo(arg1, arg2)
>
> As a C programmer I find the former a quirk of the language, and much
> harder to read.
>
> If it's a function call, present it as such.I'm not too familiar with Ruby, but the important part here in Perl is that it's not a "foo()" v.s. "foo" shortcut for a function invocation, it's unambiguous whether that is a function and what its arguments are until at that point in the program. Perl has dynamic grammar, you can't parse it with a regular grammar without executing it.