For the record, bwarnock pointed out to me that damian allready proposed
this behavior in RFC 25...

        http://dev.perl.org/rfc/25.html

That RFC doesn't suggest having the comparison operators set properties
on their result -- instead it recomends that "multiple chained comparisons
should be automagically expanded to the equivalent binary conjunction."
... I think I like his way better.  Mainly because I didn't consider the
ramifications of scenerios like this...

   $input = 4;
   $bool = $input < 22;        # $bool = 1 is valueR(22)
   print "ok!" if $bool == 1;  # whoops, '==' is looking at $bool.valueR


But as long as we're on the subject, dstorrs raises some good issues on
"should we do it at all"...


: someone (was it tchrist?) pointed out, beginners don't stay beginners for
: long, so writing a language for beginners may cost you people when they
: "grow out of" your language.  I don't this we should do this just because

I agree with that sentiment, but I don't think it applies in this case.
We're not talking about a feature that will be usefull for beginers, and
a hinderence to experienced users who move on to to another language
because being able to write "1 < $val <10" is making more work for them.

:       2) This feature would be very prone to abuse (makes it easier to
: obfuscate code), but that isn't a reason to disqualify something either.

I disagree, I think that this...

   if (1 <= $x <= 10 and 1 <= $y <= 10) {               # inside grid?

is much less obfuscated then this...

   if (1 <= $x and $x <= 10 and 1 <= $y and $y <= 10) { # inside grid?

--

-------------------------------------------------------------------
"Oh, you're a tricky one."                        Chris M Hostetter
     -- Trisha Weir                    [EMAIL PROTECTED]





Reply via email to