Re: disable coercing?

2024-02-26 Thread ToddAndMargo via perl6-users
On 2/25/24 17:45, Joseph Brenner wrote: Would this trick help? You can define a "subset" that restricts values to the uint16 range: my subset FussyUint16 of Int where 0 ..^ 2¹⁶; my FussyUint16 $x; $x = -1; ## Type check failed in assignment to $x; expected FussyUint16

Re: disable coercing?

2024-02-25 Thread Joseph Brenner
Would this trick help? You can define a "subset" that restricts values to the uint16 range: my subset FussyUint16 of Int where 0 ..^ 2¹⁶; my FussyUint16 $x; $x = -1; ## Type check failed in assignment to $x; expected FussyUint16 but got Int (-1)

Re: disable coercing?

2024-02-10 Thread ToddAndMargo via perl6-users
On 2/10/24 02:41, Elizabeth Mattijsen wrote: On 10 Feb 2024, at 08:56, ToddAndMargo via perl6-users wrote: Hi All, Is there a switch to tell Raku to bomb out with a type mismatch rather than coercing the following? my uint16 $x = -1 65535 No, this is intentional behaviour on native

Re: disable coercing?

2024-02-10 Thread Elizabeth Mattijsen
> On 10 Feb 2024, at 08:56, ToddAndMargo via perl6-users > wrote: > > Hi All, > > Is there a switch to tell Raku to bomb out with a > type mismatch rather than coercing the following? > > > my uint16 $x = -1 > 65535 No, this is intentional behaviour on native integers. Note that you can

disable coercing?

2024-02-09 Thread ToddAndMargo via perl6-users
Hi All, Is there a switch to tell Raku to bomb out with a type mismatch rather than coercing the following? > my uint16 $x = -1 65535 Many thanks, -T -- If I had a dime every time I didn't know what was going on, I'd be like, "Why is everyone giving