develooper Front page | perl.perl5.porters | Postings from December 2019

Re: Miscellaneous suggestions

From:
Zefram via perl5-porters
Date:
December 3, 2019 12:11
Subject:
Re: Miscellaneous suggestions
Message ID:
20191203121119.zof5igoiwihrc4un@fysh.org
I wrote:
>Dave Mitchell wrote:
>>    =@foo
>>    =%foo
>
>This seems more confusing than it's worth, with the implicit
>enreferencement.

Further thought: I'd be OK with a similar shorthand that made the
enreferencement explicit.  So, accepting "=" for the purposes of this
illustration, "=\@foo" would be shorthand for "(foo=>\@foo)".  Probably
only permit one reference deep, but probably permit it on scalars, subs,
and globs, not just on arrays and hashes.  Matching syntax should be
available in signatures: "foo=>\@bar" would be the syntax for an argument
named "foo" that has to be an array ref and results in the lexical named
"@bar" being aliased to that array, then "=\@foo" would be signature
shorthand for "foo=>\@foo".

-zefram



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About