Nathan Wiger wrote:
>
>One thing that Nat will soon be releasing is an RFC on strict typing.
>I'll also have one (hopefully) on an embedded tie-like solution that
>will allow you to create your own variable types. With these you would
>conceivably be able to say:
>
>   use strict 'types';
>   my packed $b = 5;     # oops!

Um, I *think* the following suggestion falls in this category. 

The other day a coworker tracked down a bug that boiled down to:

    if ($string != '')

Obviously, the operator should have been "ne". I was going to 
suggest that comparison operators, where one operand is a constant,
should produce a warning message when the operator is inappropriate.
I am sure that sometimes you'll want to do 

   if ($foo gt 5)
   
but for the most part, that's the Wrong Thing. (That would be
better written as "if ($foo gt '5')" anyhow).

In light of Nate's comment above, maybe it would be approporiate
to have this warning under "use strict 'types'" only; or perhaps
it would normally be a warning, but under "use strict 'types'",
it would be a compile-time error. If so, please add this suggestion
to the RFC. If not, should I make a separate RFC?

 ----------------------------------------------------------------------
 Eric J. Roode,  [EMAIL PROTECTED]           print  scalar  reverse  sort
 Senior Software Engineer                'tona ', 'reh', 'ekca', 'lre',
 Myxa Corporation                        '.r', 'h ', 'uj', 'p ', 'ts';

Reply via email to