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

Re: Miscellaneous suggestions

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

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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About