While making use of a Range
to solve a problem I noticed that a Range
with 0 elems would be True
as a Bool
. In what scenarios could a Range
be False
?
[0] > (^0).so
True
[1] > (1..0).so
True
The behavior does not match the design docs up to Raku v6.d, an empty Range
is expected to be False
. This is being addressed with Raku v6.e.
[0] > use v6.e.PREVIEW
Nil
[1] > (^0).so
False
[2] > (1..0).so
False