Anonymous user
Define a primitive data type: Difference between revisions
→{{header|Perl 6}}
(→{{header|JavaScript}}: Handling for non-integer values, added method toString()) |
|||
Line 864:
<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 ..
=={{header|PicoLisp}}==
|