woot! :) still learning stuff ;) - though I'll use the first.
subset Even of Int where * mod 2 == 0;
(1..1000).map: { when .is-prime { .say }
when Even { say 'EVEN Num' }
default { say 'no'}
}
Like there I just made up an new type called "Even", and used it when printing out stuff about numbers between 1 and 1000. But the really cool thing is you can use the exact sort of stuff for all kinds of variable types and even structures. It's just amazingly weird and open wonderful. I admit I've really fallen for it. ;)