Y combinator: Difference between revisions

Content deleted Content added
Thundergnat (talk | contribs)
Rename Perl 6 -> Raku, alphabetize, minor clean-up
SqrtNegInf (talk | contribs)
m →‎{{header|Raku}}: Fix comment: Perl 6 --> Raku
Line 4,209: Line 4,209:
(0 1 1 2 3 5 8 13 21 34)</pre>
(0 1 1 2 3 5 8 13 21 34)</pre>


Note that Perl 6 doesn't actually need a Y combinator because you can name anonymous functions from the inside:
Note that Raku doesn't actually need a Y combinator because you can name anonymous functions from the inside:


<lang perl6>say .(10) given sub (Int $x) { $x < 2 ?? 1 !! $x * &?ROUTINE($x - 1); }</lang>
<lang perl6>say .(10) given sub (Int $x) { $x < 2 ?? 1 !! $x * &?ROUTINE($x - 1); }</lang>