On 2020-01-28 13:36, William Michels via perl6-users wrote:
Todd, are you looking for a range smartmatch, or possibly the
".in-range" method (Rakudo-only, below)?

my $u = 248
248
say (-128..127).in-range($u);
Value out of range. Is: 248, should be in -128..127
   in block <unit> at <unknown file> line 1

my int8 $v = 0xF8;
-8
say (-128..127).in-range($v);
True
"In Rakudo only, you can use the in-range method for matching against
a range, which in fact is equivalent to smartmatch except it will
throw an exception when out of range, instead of returning False... ."

https://docs.raku.org/type/Range


I was actually look for what the range of a variable was
and how the cryptogram statued how to use it.

Butttttttt.  I can see a use for in-range too.  Thank you!

Reply via email to