News for hackers. Stuff that matters.
Re:What else are we getting wrong about programming languages? by raiph on Tuesday November 01, 2016 @01:20AM (#12843600)
Perl 6 supports arbitrary run-time predicates as "subset" types:

    subset Foo where /foo/;
    subset Bar where 0 .. 99;
    subset Baz where * > rand;

    my Foo \foovar = 'Some food';
    my Bar \barvar = 42;
    my Baz \bazvar = 0.5; # Fails typecheck half the time

There are no comments on this comment yet.