Define a primitive data type: Difference between revisions

m
Line 677:
# dies, too small. string is 0 interpreted numerically</lang>
=={{header|Perl 6}}==
{{works with|Rakudo Star|#22 "Thousand Oaks"2010-08}}
 
<lang perl6>subset OneToTen of Int where { 1 <= $^n <= 10 }
Line 686:
<code>{ 1 <= $^n <= 10 }(11)</code> returns a false value, so the second assignment throws an exception. You can use any unary function in place of <code>{ 1 <= $^n <= 10 }</code>, so this, for example, is also legal:
 
<lang perl6>subset Prime of Int where { $^n > 1 and $^n !%% none 2 .. sqrt $^n }</lang>
 
=={{header|PicoLisp}}==
Anonymous user