On 22/06/2010 09:07, Richard Hainsworth wrote:
I was going to suggest this too after reading PM's post. I would suggest
that for whatever reason a list operator was used on a scalar, including
a hold over form another language (Ruby and perl5), a warning should be
issued. Most likely to be an error.


For a nop? Ouch.

Could this not be pushed off onto a lint-like/PBP analysis? If you want the compiler to moan about every construct that may not be doing what you think it's doing... you don't want to do that every time the program is run.

David

On 06/21/2010 11:05 PM, yary wrote:
Warning on using any list-y op on a scalar seems like a good idea, and
the fact that the idea arose after a perl5 misunderstanding now looks
like a "red herring". That is, while warning on "only"
reverse-on-a-scalar may be a bad idea and perl5 specific, I'd vote for
warning on all apparent mis-uses of list ops on scalars as a generally
helpful.

--
There's bum trash in my hall and my place is ripped
I've totaled another amp, I'm calling in sick

Reply via email to