Anonymous user
Pascal's triangle: Difference between revisions
→{{header|Perl 6}}: Note behavior for n <= 0 as per task description
(→{{header|jq}}: Using recurse/1) |
(→{{header|Perl 6}}: Note behavior for n <= 0 as per task description) |
||
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>
=== recursive ===
{{trans|Haskell}}
▲Non-positive inputs throw a multiple-dispatch error.
<lang perl6>multi pascal (1) { [1] }
Line 2,057:
.say for pascal 10;</lang>
Non-positive inputs throw a multiple-dispatch error.
=== iterative ===
Line 2,070 ⟶ 2,072:
pascal 10;</lang>
Non-positive inputs throw a type check error.
{{Output}}
|