Is there a straightforward way to check if something is a mixin?
5
Raku mixins have two (or more) natures, combining several values in the same container, or values along with roles. However, there is not, as far as I can tell, a straightforward way to check for "mixinity" in a variable that has not been created by you.
This might be a trick
my $foo = 3 but Stringy;
say $foo.^name ~~ /\+/;# OUTPUT: «「+」»
But is there any other property I'm missing that would allow to look this up directly?
mixins raku
.VAR
if it's aScalar
). And introspecting a variable itself would require yet another incantation (using something like.var.VAR
). – raiph Apr 1 at 1:40