develooper Front page | perl.perl5.porters | Postings from August 2021

Re: Twigils

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
August 15, 2021 01:57
Subject:
Re: Twigils
Message ID:
efd2c41b-f223-4411-8587-65b25599c5f2@beta.fastmail.com
On Sat, Aug 14, 2021, at 9:32 PM, Philip R Brenan wrote:
> Please avoid twigils.  They are quasi operators.  As  operators they ought to be optional.

It is unclear what you mean by this.  Twigils are not operators.  (While there may have been an argument to have been made in the days of Perl v3 that sigils were operators, it ceased to hold water in Perl v5, when lexical variables eliminated the necessity of a glob in a symbol table.)  Twigils are syntactic extras in the name of a variable that constrain it in some way.  The dollar sign means it will be a scalar.  The at sign, an array.  Ruby uses sigils, of a sort, in a similar way, but largely to indicate scope.  Twigils could allow multiple constraints to be applied at once.

But at any rate, do you mean that all operators should be optional?  Writing a program without operators is not something to be attempted in Perl 5 for any reason other than stunt programming.

-- 
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