# Re: Suggested magic for "a" .. "b"

```TSa wrote:
> Swapping the endpoints could mean swapping inside test to outside
> test. The only thing that is needed is to swap from && to ||:
>
>   \$a .. \$b   # means  \$a <= \$_ && \$_ <= \$b  if \$a < \$b
>   \$b .. \$a   # means  \$b <= \$_ || \$_ <= \$a  if \$a < \$b```
```
This is the same sort of discontinuity of meaning that was causing
problems with Perl 5's use of negative indices to count backward from
the end of a list; there's a reason why Perl 6 now uses the [*-\$a]
notation for that sort of thing.

Consider a code snippet where the programmer is given two values: one
is a minimum value which must be reached; the other is a maximum value
which must not be exceeded.  In this example, the programmer does not
know what the values are; for all he knows, the minimum threshold
exceeds the maximum.  As things stand, it's trivial to test whether or
not your sample value is viable: if "\$x ~~ \$min .. \$max", then you're
golden: it doesn't matter what "\$min cmp \$max" is.  With your change,
I'd have to replace the above with something along the lines of:
"if \$min <= \$max && \$x ~~ \$min .. \$max { ... }" - because if \$min >
\$max, the algorithm will accept values that are well below the minimum
as well as values that are well above the maximum.

Keep it simple, folks!  There are enough corner cases in Perl 6 as
things stand; we don't need to be introducing more of them if we can
help it.

--
Jonathan "Dataweaver" Lang
```