Define a primitive data type: Difference between revisions

(→‎{{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 .. sqrt ($^n.sqrt)) }</lang>
 
=={{header|PicoLisp}}==
Anonymous user