(I sent this to horos in the first RFC format, before the language
list.  I haven't got any response, so I send this agian now.  I don't
have time to read the list or maintain an RFC.  I just wan't to give
this suggestion.)


Does any other RFC give the equivalent to an 'in' operator?


I have a couple of times noticed that beginners in programming want to
write if( $a eq ($b or $c or $d)){...} and expects it to mean
if( $a eq $b or $a eq $c or $a eq $d ){...}.

I think it's a natural human reaction to not be repetative. An 'in'
operator will help here. It could be something like this:

    $a in @b; # Has @b any element exactly the same as $a

    $a == in @b; # Is any element numericaly the same as $a
    $a eq in @b;
    $a > in @b;  # Is $a bigger than any element in @b?
    $a not in @b; # Yes. Make 'not' context dependent modifier for in.
    ...

You could even use it as a version of the ||| operator. :-)
    $a = in @b; # Assign the first defined value to $a


-- 
/ Jonas  -  http://jonas.liljegren.org/myself/en/index.html

Reply via email to