On Wed Apr 21 21:42:33 2010, clonezone wrote:
Show quoted text> On 4/15/10 8:14 AM, Jari Aalto via RT wrote:
> > That should be handled more carefully and not label everything
> > <sigil><sigil> as suspect.
>
> If you pay attention to what Conway is talking about, he is not
> discussing bugs. He's talking about communicating intent. A
> significant portion of Perl developers don't understand the
> precedence of the expression "$$foo->bar()": does it mean "${$foo-
> >bar()}" or does it mean "${$foo}->bar()"? You and I may know the
> answer, but Conway's point is that most people do not, so he wants
> you to always separate your sigils.
Sure, a message for complex expressions is ok, but the bug report and my
last comment was addressed to:
<full variable name> := simple expression
That doesn't include "$$foo->"
Labeling everything suspect is not a good idea. If someone wants to to
be fanatic, he may consider including cases like
@$var (and the like)
to be a suspect.
But in practice it would be hard to find a Perl coder that would find
code like above to be "ambiguous" or prone to "misinterpretation". Any
added punctuation to that will make it less clear in spirit of "less is
more" (according to the XP methodology in programming).
TO RECAP
---------
Fine tune the warning:
- allow simple cases and do not emit warnings on those:
<sigil><sigil><straight simple variable>
Better: offer configuration to bypass simple cases and continue to emit
warnings from more complex cases.