Re: Changing the error message from subset type violation

2020-01-12 Thread yary
As I was next to you in today's Raku gathering, I came up with this as a sort-of answer. Not very happy with it but it gets partway there. #!/usr/bin/env perl6 use v6.d; ## Simple version to check membership, but the type error won't tell which strings # subset Critter of Str where any ## This

Changing the error message from subset type violation

2020-01-12 Thread Joseph Brenner
I was just playing around with using a "subset" to restrict a string to a set of allowed values: subset Monster of Str where * eq any( << godzilla mothera blob tingler grendel minotaur >> ); my Monster $thingie; $thingie = 'grendel'; # accepts this as expected $thingie = 'nada'; # f