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

proposal: deprecate exists on array elements

Thread Next
From:
Ricardo Signes
Date:
September 3, 2021 16:51
Subject:
proposal: deprecate exists on array elements
Message ID:
532025f7-9cb1-4cec-b585-bf3f6b5999ee@beta.fastmail.com
**Porters,

Every once in a while, somebody suggests that "exists $arr[3]" can be useful.  This is almost never true, and most often based on a misapprehension of what it means.  (No, it's not a sparse array.  No, it's not a useful test of array length.)

I think it's time to deprecate this behavior so it can be fatalized, as "defined @array" finally was.  The reasoning here is "this feature is not useful, and is providing a leak into our abstraction.  It confuses experts and new users alike, and is unlikely to be performing important work in real code."

This is a "What objections, if any, still stand in the way of doing this?" email.

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