Pascal's triangle: Difference between revisions

Content added Content deleted
(→‎{{header|jq}}: Using recurse/1)
(→‎{{header|Perl 6}}: Note behavior for n <= 0 as per task description)
Line 2,043: Line 2,043:


<small>(A desperate garbage collector may still trim an overly long lazy constant, since it can always be recreated later, assuming the programmer didn't lie about its constancy.)</small>
<small>(A desperate garbage collector may still trim an overly long lazy constant, since it can always be recreated later, assuming the programmer didn't lie about its constancy.)</small>

Non-positive inputs throw an index-out-of-bounds error.


=== recursive ===
=== recursive ===


{{trans|Haskell}}
{{trans|Haskell}}

Non-positive inputs throw a multiple-dispatch error.


<lang perl6>multi pascal (1) { [1] }
<lang perl6>multi pascal (1) { [1] }
Line 2,057: Line 2,057:


.say for pascal 10;</lang>
.say for pascal 10;</lang>

Non-positive inputs throw a multiple-dispatch error.


=== iterative ===
=== iterative ===
Line 2,070: Line 2,072:


pascal 10;</lang>
pascal 10;</lang>

Non-positive inputs throw a type check error.


{{Output}}
{{Output}}