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

Wording for lvalue ref error messages

Thread Next
From:
Father Chrysostomos
Date:
September 28, 2014 18:12
Subject:
Wording for lvalue ref error messages
Message ID:
20140928181224.11512.qmail@lists-nntp.develooper.com
Since \(%h) flattens the hash and takes references to all the keys
and values, \(%h)=... doesn't make sense (keys can't be aliased) and
should be disallowed.  The error message I'm using for that is:

    Can't modify reference to parenthesized hash in list assignment

I can make \(@a)=... work, but \local(@a)=... is another matter.  That
would require an entirely new localisation mechanism, which I am not
about to implement.  So we need an error message for it.  The best I
can come up with is:

    Can't modify reference to parenthesized localized array in list assignment

But 'reference to parenthesized localized array' seems a bit of a
mouthful.  I thought about 'reference to local(@array)', but that is
less helpful, because it is not obvious that the parentheses are the
problem here.  (\local @a=... is allowed and should work within eleven
hours or so. :-)

Any suggestions?


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